code: func parseRemoteRef(remote string) (reference.Named, string, error) {
  	// Parse remote reference, supporting remotes with name and tag
  	remoteRef, err := reference.ParseNormalizedNamed(remote)
  	if err != nil {
  		return nil, "", err
  	}
  
  	type canonicalWithTag interface {
  		reference.Canonical
  		Tag() string
  	}
  
  	if canonical, ok := remoteRef.(canonicalWithTag); ok {
  		remoteRef, err = reference.WithDigest(reference.TrimNamed(remoteRef), canonical.Digest())
  		if err != nil {
  			return nil, "", err
  		}
  		return remoteRef, canonical.Tag(), nil
  	}
  
  	remoteRef = reference.TagNameOnly(remoteRef)
  
  	return remoteRef, "", nil
  }
docs: // parseRemoteRef parses the remote reference into a reference.Named
  // returning the tag associated with the reference. In the case the
  // given reference string includes both digest and tag, the returned
  // reference will have the digest without the tag, but the tag will
  // be returned.