code: func (r *Repository) Tag(name string) (*plumbing.Reference, error) {
  	ref, err := r.Reference(plumbing.ReferenceName(path.Join("refs", "tags", name)), false)
  	if err != nil {
  		if err == plumbing.ErrReferenceNotFound {
  			// Return a friendly error for this one, versus just ReferenceNotFound.
  			return nil, ErrTagNotFound
  		}
  
  		return nil, err
  	}
  
  	return ref, nil
  }
docs: // Tag returns a tag from the repository.
  //
  // If you want to check to see if the tag is an annotated tag, you can call
  // TagObject on the hash of the reference in ForEach:
  //
  //   ref, err := r.Tag("v0.1.0")
  //   if err != nil {
  //     // Handle error
  //   }
  //
  //   obj, err := r.TagObject(ref.Hash())
  //   switch err {
  //   case nil:
  //     // Tag object present
  //   case plumbing.ErrObjectNotFound:
  //     // Not a tag object
  //   default:
  //     // Some other error
  //   }
  //