code: func (r *Session) GetRemoteTag(registries []string, repositoryRef reference.Named, askedTag string) (string, error) {
  	repository := reference.Path(repositoryRef)
  
  	if strings.Count(repository, "/") == 0 {
  		// This will be removed once the registry supports auto-resolution on
  		// the "library" namespace
  		repository = "library/" + repository
  	}
  	for _, host := range registries {
  		endpoint := fmt.Sprintf("%srepositories/%s/tags/%s", host, repository, askedTag)
  		res, err := r.client.Get(endpoint)
  		if err != nil {
  			return "", err
  		}
  
  		logrus.Debugf("Got status code %d from %s", res.StatusCode, endpoint)
  		defer res.Body.Close()
  
  		if res.StatusCode == 404 {
  			return "", ErrRepoNotFound
  		}
  		if res.StatusCode != 200 {
  			continue
  		}
  
  		var tagID string
  		if err := json.NewDecoder(res.Body).Decode(&tagID); err != nil {
  			return "", err
  		}
  		return tagID, nil
  	}
  	return "", fmt.Errorf("Could not reach any registry endpoint")
  }
docs: // GetRemoteTag retrieves the tag named in the askedTag argument from the given
  // repository. It queries each of the registries supplied in the registries
  // argument, and returns data from the first one that answers the query
  // successfully.