Skip to content

Commit 3e5564a

Browse files
fix: Resolve golangci-lint errors
- Fix unchecked return value for stdin.Write in go.go - Fix unchecked return value for server.Stop in oauth_wizard.go - Remove unused ide_config.go file - Remove unused getOAuthConfigForProvider function - Remove unused promptYesNo function - Remove unused provider import from oauth_wizard.go All linter errors have been resolved and build passes successfully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5240bcb commit 3e5564a

File tree

4 files changed

+2
-241
lines changed

4 files changed

+2
-241
lines changed

internal/config/interactive/ide_config.go

Lines changed: 0 additions & 192 deletions
This file was deleted.

internal/config/interactive/oauth_wizard.go

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"time"
77

88
"github.com/cecil-the-coder/mcp-code-api/internal/api/auth"
9-
"github.com/cecil-the-coder/mcp-code-api/internal/api/provider"
109
"github.com/cecil-the-coder/mcp-code-api/internal/logger"
1110
"github.com/cecil-the-coder/mcp-code-api/internal/oauth"
1211
)
@@ -41,7 +40,7 @@ func (w *Wizard) performOAuthFlow(providerName string, config ProviderOAuthConfi
4140
if err != nil {
4241
return nil, fmt.Errorf("failed to start callback server: %w", err)
4342
}
44-
defer server.Stop()
43+
defer func() { _ = server.Stop() }()
4544

4645
if err := server.Start(); err != nil {
4746
return nil, fmt.Errorf("failed to start callback server: %w", err)
@@ -191,27 +190,3 @@ func (w *Wizard) configureProviderOAuth(providerName, displayName string) (*Prov
191190

192191
return config, tokenInfo, nil
193192
}
194-
195-
// getOAuthConfigForProvider returns OAuth config for a provider in the config format
196-
func getOAuthConfigForProvider(oauthConfig *ProviderOAuthConfig, tokenInfo *auth.TokenInfo) *provider.OAuthConfig {
197-
if oauthConfig == nil {
198-
return nil
199-
}
200-
201-
providerConfig := &provider.OAuthConfig{
202-
ClientID: oauthConfig.ClientID,
203-
ClientSecret: oauthConfig.ClientSecret,
204-
RedirectURL: "", // Will be set during flow
205-
Scopes: oauthConfig.Scopes,
206-
AuthURL: oauthConfig.AuthURL,
207-
TokenURL: oauthConfig.TokenURL,
208-
}
209-
210-
if tokenInfo != nil {
211-
providerConfig.AccessToken = tokenInfo.AccessToken
212-
providerConfig.RefreshToken = tokenInfo.RefreshToken
213-
providerConfig.ExpiresAt = tokenInfo.ExpiresAt
214-
}
215-
216-
return providerConfig
217-
}

internal/config/interactive/wizard.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -626,28 +626,6 @@ func (w *Wizard) prompt(prompt string, allowEmpty bool) string {
626626
}
627627
}
628628

629-
// promptYesNo prompts the user for a yes/no answer
630-
func (w *Wizard) promptYesNo(prompt string, defaultValue bool) bool {
631-
for {
632-
fmt.Print(prompt)
633-
input, err := w.reader.ReadString('\n')
634-
if err != nil {
635-
// Handle EOF or other input errors gracefully - just return default
636-
return defaultValue
637-
}
638-
639-
input = strings.ToLower(strings.TrimSpace(input))
640-
switch input {
641-
case "y", "yes":
642-
return true
643-
case "n", "no", "":
644-
return defaultValue
645-
default:
646-
fmt.Println("Please enter 'y' or 'n'.")
647-
}
648-
}
649-
}
650-
651629
// saveConfiguration prompts for config file location and saves the configuration
652630
func (w *Wizard) saveConfiguration() (string, error) {
653631
fmt.Println("\n💾 Save Configuration")

internal/validation/go.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (v *GoValidator) AutoFix(code string) (string, error) {
7979

8080
go func() {
8181
defer stdin.Close()
82-
stdin.Write([]byte(code))
82+
_, _ = stdin.Write([]byte(code))
8383
}()
8484

8585
output, err := cmd.CombinedOutput()

0 commit comments

Comments
 (0)