code: func ParseDockerURL(arg string) (*ParsedDockerURL, error) {
  	r, err := reference.ParseNormalizedNamed(arg)
  	if err != nil {
  		return nil, err
  	}
  
  	var tag, digest string
  	switch x := r.(type) {
  	case reference.Canonical:
  		digest = x.Digest().String()
  	case reference.NamedTagged:
  		tag = x.Tag()
  	default:
  		tag = defaultTag
  	}
  
  	indexURL, remoteName := docker.SplitReposName(reference.FamiliarName(r))
  
  	return &ParsedDockerURL{
  		OriginalName: arg,
  		IndexURL:     indexURL,
  		ImageName:    remoteName,
  		Tag:          tag,
  		Digest:       digest,
  	}, nil
  }
docs: // ParseDockerURL takes a Docker URL and returns a ParsedDockerURL with its
  // index URL, image name, and tag.