code: func FromConfig(authConfig string) (AuthMode, error) {
  	if authConfig == "" {
  		return nil, ErrNoAuth
  	}
  	pieces := strings.SplitN(authConfig, ":", 2)
  	if len(pieces) < 1 {
  		return nil, fmt.Errorf("Invalid auth string: %q", authConfig)
  	}
  	authType := pieces[0]
  
  	if fn, ok := authConstructor[authType]; ok {
  		arg := ""
  		if len(pieces) == 2 {
  			arg = pieces[1]
  		}
  		return fn(arg)
  	}
  	return nil, fmt.Errorf("Unknown auth type: %q", authType)
  }
docs: // FromConfig parses authConfig and accordingly sets up the AuthMode
  // that will be used for all upcoming authentication exchanges. The
  // supported modes are UserPass and DevAuth. UserPass requires an authConfig
  // of the kind "userpass:joe:ponies".
  //
  // If the input string is empty, the error will be ErrNoAuth.