code: func ValidateRemote(remote string) error {
  	remotes, err := RemoteList()
  	if err != nil {
  		return err
  	}
  	for _, r := range remotes {
  		if r == remote {
  			return nil
  		}
  	}
  
  	if err = ValidateRemoteURL(remote); err == nil {
  		return nil
  	}
  
  	return fmt.Errorf("Invalid remote name: %q", remote)
  }
docs: // ValidateRemote checks that a named remote is valid for use
  // Mainly to check user-supplied remotes & fail more nicely