code: func WithTag(name Named, tag string) (NamedTagged, error) {
  	if !anchoredTagRegexp.MatchString(tag) {
  		return nil, ErrTagInvalidFormat
  	}
  	var repo repository
  	if r, ok := name.(namedRepository); ok {
  		repo.domain = r.Domain()
  		repo.path = r.Path()
  	} else {
  		repo.path = name.Name()
  	}
  	if canonical, ok := name.(Canonical); ok {
  		return reference{
  			namedRepository: repo,
  			tag:             tag,
  			digest:          canonical.Digest(),
  		}, nil
  	}
  	return taggedReference{
  		namedRepository: repo,
  		tag:             tag,
  	}, nil
  }
docs: // WithTag combines the name from "name" and the tag from "tag" to form a
  // reference incorporating both the name and the tag.