code: func (m *mapper) infoForData(data []byte, source string) (*Info, error) {
  	obj, gvk, err := m.decoder.Decode(data, nil, nil)
  	if err != nil {
  		return nil, fmt.Errorf("unable to decode %q: %v", source, err)
  	}
  
  	name, _ := metadataAccessor.Name(obj)
  	namespace, _ := metadataAccessor.Namespace(obj)
  	resourceVersion, _ := metadataAccessor.ResourceVersion(obj)
  
  	ret := &Info{
  		Source:          source,
  		Namespace:       namespace,
  		Name:            name,
  		ResourceVersion: resourceVersion,
  
  		Object: obj,
  	}
  
  	if m.localFn == nil || !m.localFn() {
  		restMapper, err := m.restMapperFn()
  		if err != nil {
  			return nil, err
  		}
  		mapping, err := restMapper.RESTMapping(gvk.GroupKind(), gvk.Version)
  		if err != nil {
  			return nil, fmt.Errorf("unable to recognize %q: %v", source, err)
  		}
  		ret.Mapping = mapping
  
  		client, err := m.clientFn(gvk.GroupVersion())
  		if err != nil {
  			return nil, fmt.Errorf("unable to connect to a server to handle %q: %v", mapping.Resource, err)
  		}
  		ret.Client = client
  	}
  
  	return ret, nil
  }
docs: // InfoForData creates an Info object for the given data. An error is returned
  // if any of the decoding or client lookup steps fail. Name and namespace will be
  // set into Info if the mapping's MetadataAccessor can retrieve them.