code: func (c *TagCache) ResolveExtractedObjectRef(ctx context.Context, pin common.Pin, fileName string) (*api.ObjectRef, error) {
  	if err := common.ValidatePin(pin, common.AnyHash); err != nil {
  		return nil, err
  	}
  
  	ignoreBrokenObjectRef := func(iid string) *api.ObjectRef {
  		if err := common.ValidateInstanceID(iid, common.AnyHash); err != nil {
  			logging.Errorf(ctx, "Stored object_ref %q for %q in %s is invalid, ignoring it - %s", iid, fileName, pin, err)
  			return nil
  		}
  		return common.InstanceIDToObjectRef(iid)
  	}
  
  	c.lock.Lock()
  	defer c.lock.Unlock()
  
  	key := makeFileKey(pin.PackageName, pin.InstanceID, fileName)
  	if e := c.addedFiles[key]; e != nil {
  		return ignoreBrokenObjectRef(e.ObjectRef), nil
  	}
  
  	if err := c.lazyLoadLocked(ctx); err != nil {
  		return nil, err
  	}
  
  	// Most recently used entries are usually at the end, search in reverse as a
  	// silly optimization.
  	for i := len(c.cache.FileEntries) - 1; i >= 0; i-- {
  		e := c.cache.FileEntries[i]
  		if e.Package == pin.PackageName && e.InstanceId == pin.InstanceID && e.FileName == fileName {
  			return ignoreBrokenObjectRef(e.ObjectRef), nil
  		}
  	}
  	return nil, nil
  }
docs: // ResolveExtractedObjectRef returns ObjectRef or nil if that file is not in the
  // cache.
  //
  // Returns error if the cache can't be read.