diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-03 08:08:51 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-03 08:08:51 +0300 |
| commit | d53b03d280363ecc6068ba93985adfc4defee956 (patch) | |
| tree | 741182d83abd584fb133da2057a9af986d8f8a41 | |
| parent | 170a4a9d46a32bcb28c04f6ff6bb1a48284ec424 (diff) | |
fix: resolve all golangci-lint issues
- audio/fallbacks.go: lowercase error string per Go convention
- gui/app.go: remove empty else branch in keyboard shortcut handler
- audio/provider_test.go: remove unused mockProvider type
- update test assertions in voices_test.go and processor_test.go to match
the corrected lowercase error string
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rw-r--r-- | internal/audio/fallbacks.go | 2 | ||||
| -rw-r--r-- | internal/audio/provider_test.go | 30 | ||||
| -rw-r--r-- | internal/audio/voices_test.go | 2 | ||||
| -rw-r--r-- | internal/gui/app.go | 3 | ||||
| -rw-r--r-- | internal/processor/processor_test.go | 2 |
5 files changed, 4 insertions, 35 deletions
diff --git a/internal/audio/fallbacks.go b/internal/audio/fallbacks.go index f22301f..587474d 100644 --- a/internal/audio/fallbacks.go +++ b/internal/audio/fallbacks.go @@ -27,5 +27,5 @@ func RunWithVoiceFallbacks(initialVoice string, generate func(voice string) erro } } - return "", fmt.Errorf("Gemini returned no audio for voices %s: %w", strings.Join(attempted, ", "), lastErr) + return "", fmt.Errorf("gemini returned no audio for voices %s: %w", strings.Join(attempted, ", "), lastErr) } diff --git a/internal/audio/provider_test.go b/internal/audio/provider_test.go index 9b8037c..92bb94e 100644 --- a/internal/audio/provider_test.go +++ b/internal/audio/provider_test.go @@ -1,41 +1,11 @@ package audio import ( - "context" "path/filepath" "strings" "testing" ) -// mockProvider implements Provider interface for testing -type mockProvider struct { - name string - generateErr error - availableErr error - generateCalls int -} - -func (m *mockProvider) GenerateAudio(ctx context.Context, text string, outputFile string) error { - m.generateCalls++ - return m.generateErr -} - -func (m *mockProvider) Name() string { - return m.name -} - -func (m *mockProvider) IsAvailable() error { - return m.availableErr -} - -func (m *mockProvider) Voices() []string { - return nil -} - -func (m *mockProvider) BuildAttribution(params AttributionParams) string { - return "" -} - func TestDefaultProviderConfig(t *testing.T) { config := DefaultProviderConfig() diff --git a/internal/audio/voices_test.go b/internal/audio/voices_test.go index 6d79634..9507c5f 100644 --- a/internal/audio/voices_test.go +++ b/internal/audio/voices_test.go @@ -121,7 +121,7 @@ func TestRunWithVoiceFallbacks(t *testing.T) { if got, want := attempted, []string{"Charon", "Kore", "Leda"}; !reflect.DeepEqual(got, want) { t.Fatalf("attempted voices = %#v, want %#v", got, want) } - if got := err.Error(); got != "Gemini returned no audio for voices Charon, Kore, Leda: no audio data returned from Gemini" { + if got := err.Error(); got != "gemini returned no audio for voices Charon, Kore, Leda: no audio data returned from Gemini" { t.Fatalf("error text = %q, want wrapped attempted-voices summary", got) } }) diff --git a/internal/gui/app.go b/internal/gui/app.go index e5cc9dd..13b3136 100644 --- a/internal/gui/app.go +++ b/internal/gui/app.go @@ -2604,10 +2604,9 @@ func (a *Application) setupKeyboardShortcuts() { if !a.regenerateAudioBtn.Disabled() { a.onRegenerateAudio() } - case 'A', 'А': // A = regenerate back audio (for bg-bg cards) + case 'A', 'А': // A = regenerate back audio (for bg-bg cards only) if a.currentCardType == "bg-bg" { a.onRegenerateBackAudio() - } else { } case 'р', 'Р': // р = r if !a.regenerateAllBtn.Disabled() { diff --git a/internal/processor/processor_test.go b/internal/processor/processor_test.go index 0d0e9e3..bcd57a7 100644 --- a/internal/processor/processor_test.go +++ b/internal/processor/processor_test.go @@ -789,7 +789,7 @@ func TestGenerateAudioReturnsExhaustedGeminiFallbackError(t *testing.T) { if !errors.Is(err, audio.ErrGeminiNoAudioData) { t.Fatalf("generateAudio() error = %v, want wrapped ErrGeminiNoAudioData", err) } - if got, want := err.Error(), "Gemini returned no audio for voices Charon: no audio data returned from Gemini"; got != want { + if got, want := err.Error(), "gemini returned no audio for voices Charon: no audio data returned from Gemini"; got != want { t.Fatalf("generateAudio() error text = %q, want %q", got, want) } } |
