code: func ValidateRemoteURL(remote string) error {
  	u, _ := url.Parse(remote)
  	if u == nil || u.Scheme == "" {
  		// This is either an invalid remote name (maybe the user made a typo
  		// when selecting a named remote) or a bare SSH URL like
  		// "x@y.com:path/to/resource.git". Guess that this is a URL in the latter
  		// form if the string contains a colon ":", and an invalid remote if it
  		// does not.
  		if strings.Contains(remote, ":") {
  			return nil
  		} else {
  			return fmt.Errorf("Invalid remote name: %q", remote)
  		}
  	}
  
  	switch u.Scheme {
  	case "ssh", "http", "https", "git":
  		return nil
  	default:
  		return fmt.Errorf("Invalid remote url protocol %q in %q", u.Scheme, remote)
  	}
  }
docs: // ValidateRemoteURL checks that a string is a valid Git remote URL