code: func ValidateIndexName(val string) (string, error) {
  	// TODO: upstream this to check to reference package
  	if val == "index.docker.io" {
  		val = "docker.io"
  	}
  	if strings.HasPrefix(val, "-") || strings.HasSuffix(val, "-") {
  		return "", fmt.Errorf("invalid index name (%s). Cannot begin or end with a hyphen", val)
  	}
  	return val, nil
  }
docs: // ValidateIndexName validates an index name.