code: func (i *ImageService) TagImage(imageName, repository, tag string) (string, error) {
  	img, err := i.GetImage(imageName)
  	if err != nil {
  		return "", err
  	}
  
  	newTag, err := reference.ParseNormalizedNamed(repository)
  	if err != nil {
  		return "", err
  	}
  	if tag != "" {
  		if newTag, err = reference.WithTag(reference.TrimNamed(newTag), tag); err != nil {
  			return "", err
  		}
  	}
  
  	err = i.TagImageWithReference(img.ID(), newTag)
  	return reference.FamiliarString(newTag), err
  }
docs: // TagImage creates the tag specified by newTag, pointing to the image named
  // imageName (alternatively, imageName can also be an image ID).