code: func (ims *InstanceMetadataService) GetMetadata() (*InstanceMetadata, error) {
  	cache, err := ims.imsCache.Get(metadataCacheKey)
  	if err != nil {
  		return nil, err
  	}
  
  	// Cache shouldn't be nil, but added a check incase something wrong.
  	if cache == nil {
  		return nil, fmt.Errorf("failure of getting instance metadata")
  	}
  
  	if metadata, ok := cache.(*InstanceMetadata); ok {
  		return metadata, nil
  	}
  
  	return nil, fmt.Errorf("failure of getting instance metadata")
  }
docs: // GetMetadata gets instance metadata from cache.