@@ -41,7 +41,7 @@ func init() {
4141}
4242
4343// resolveRegistration returns a client ID and scopes, registering dynamically if needed.
44- func resolveRegistration (ctx context.Context , authBaseURL string , cmd * cobra.Command ) (string , []string , error ) {
44+ func resolveRegistration (ctx context.Context , authBaseURL string , cmd * cobra.Command ) (clientID string , scopes []string , err error ) {
4545 if clientID , _ := cmd .Flags ().GetString ("client-id" ); clientID != "" {
4646 return clientID , nil , nil
4747 }
@@ -52,14 +52,14 @@ func resolveRegistration(ctx context.Context, authBaseURL string, cmd *cobra.Com
5252}
5353
5454// registerAndCache calls POST /oauth/register and saves the client_id and scopes.
55- func registerAndCache (ctx context.Context , authBaseURL string , cmd * cobra.Command ) (string , []string , error ) {
55+ func registerAndCache (ctx context.Context , authBaseURL string , cmd * cobra.Command ) (clientID string , scopes []string , err error ) {
5656 _ , _ = fmt .Fprintf (cmd .OutOrStderr (), "Registering OAuth client...\n " )
57- clientID , scopes , err : = xoauth .RegisterClient (ctx , authBaseURL )
57+ clientID , scopes , err = xoauth .RegisterClient (ctx , authBaseURL )
5858 if err != nil {
5959 return "" , nil , err
6060 }
61- if err := xoauth .SaveRegistration (clientID , scopes ); err != nil {
62- return "" , nil , fmt .Errorf ("failed to cache registration: %w" , err )
61+ if saveErr := xoauth .SaveRegistration (clientID , scopes ); saveErr != nil {
62+ return "" , nil , fmt .Errorf ("failed to cache registration: %w" , saveErr )
6363 }
6464 return clientID , scopes , nil
6565}
0 commit comments