From 3d755fd57a3824ca01d76bad25675d9e400fd6aa Mon Sep 17 00:00:00 2001 From: Mathias Date: Thu, 1 Oct 2026 23:26:02 +0200 Subject: [PATCH] fix(transcribe): check (discard) the deferred Close errors golangci-lint flags Found because the project's lint step cannot fail: the Taskfile runs 'golangci-lint run ./... || echo "not installed -- skipping"', so a failing lint prints that message and exits 0. CI's log showed these findings and still passed. Co-Authored-By: Claude Sonnet 5.5 --- internal/adapters/transcribe/gateway.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/adapters/transcribe/gateway.go b/internal/adapters/transcribe/gateway.go index 33cf464..763fcc4 100644 --- a/internal/adapters/transcribe/gateway.go +++ b/internal/adapters/transcribe/gateway.go @@ -62,7 +62,7 @@ func (g *Gateway) Transcribe(ctx context.Context, path string) (domain.Transcrip if err != nil { return domain.Transcription{}, fmt.Errorf("transcribe: open audio: %w", err) } - defer f.Close() + defer func() { _ = f.Close() }() info, err := f.Stat() if err != nil { return domain.Transcription{}, fmt.Errorf("transcribe: stat audio: %w", err) @@ -95,7 +95,7 @@ func (g *Gateway) Transcribe(ctx context.Context, path string) (domain.Transcrip if err != nil { return domain.Transcription{}, fmt.Errorf("transcribe: %s: %w", g.model, err) } - defer resp.Body.Close() + defer func() { _ = resp.Body.Close() }() if resp.StatusCode < 200 || resp.StatusCode > 299 { snip, _ := io.ReadAll(io.LimitReader(resp.Body, 200)) return domain.Transcription{}, &StatusError{Code: resp.StatusCode, Snippet: strings.TrimSpace(string(snip))}