code: func (t *tags) Get(ctx context.Context, tag string) (distribution.Descriptor, error) {
  	ref, err := reference.WithTag(t.name, tag)
  	if err != nil {
  		return distribution.Descriptor{}, err
  	}
  	u, err := t.ub.BuildManifestURL(ref)
  	if err != nil {
  		return distribution.Descriptor{}, err
  	}
  
  	newRequest := func(method string) (*http.Response, error) {
  		req, err := http.NewRequest(method, u, nil)
  		if err != nil {
  			return nil, err
  		}
  
  		for _, t := range distribution.ManifestMediaTypes() {
  			req.Header.Add("Accept", t)
  		}
  		resp, err := t.client.Do(req)
  		return resp, err
  	}
  
  	resp, err := newRequest("HEAD")
  	if err != nil {
  		return distribution.Descriptor{}, err
  	}
  	defer resp.Body.Close()
  
  	switch {
  	case resp.StatusCode >= 200 && resp.StatusCode < 400 && len(resp.Header.Get("Docker-Content-Digest")) > 0:
  		// if the response is a success AND a Docker-Content-Digest can be retrieved from the headers
  		return descriptorFromResponse(resp)
  	default:
  		// if the response is an error - there will be no body to decode.
  		// Issue a GET request:
  		//   - for data from a server that does not handle HEAD
  		//   - to get error details in case of a failure
  		resp, err = newRequest("GET")
  		if err != nil {
  			return distribution.Descriptor{}, err
  		}
  		defer resp.Body.Close()
  
  		if resp.StatusCode >= 200 && resp.StatusCode < 400 {
  			return descriptorFromResponse(resp)
  		}
  		return distribution.Descriptor{}, HandleErrorResponse(resp)
  	}
  }
docs: // Get issues a HEAD request for a Manifest against its named endpoint in order
  // to construct a descriptor for the tag.  If the registry doesn't support HEADing
  // a manifest, fallback to GET.