You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: metadata_decoder.go
    path of file: ./repos/kubeedge/vendor/k8s.io/cli-runtime/pkg/resource
    
    the code of the file until where you have to start completion: /*
Copyright 2019 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the L
    
func (m *metadataValidatingDecoder) Decode(data []byte, defaults *schema.GroupVersionKind, into runtime.Object) (runtime.Object, *schema.GroupVersionKind, error) {
	obj, gvk, err := m.decoder.Decode(data, defaults, into)

	// if we already errored, return
	if err != nil {
		return obj, gvk, err
	}

	// if we're not unstructured, return
	if _, isUnstructured := obj.(runtime.Unstructured); !isUnstructured {
		return obj, gvk, err
	}

	// make sure the data can decode into ObjectMeta before we return,
	// so we don't silently truncate schema errors in metadata later with accesser get/set calls
	v := &metadataOnlyObject{}
	if typedErr := utiljson.Unmarshal(data, v); typedErr != nil {
		return obj, gvk, typedErr
	}
	return obj, gvk, err
}