From f5b997bfc4c77ef262726d14b30d387eb7acd1c6 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sun, 25 Jan 2026 20:55:58 -1000 Subject: Fix all static analysis errors (golangci-lint) - Fix errcheck: handle all error return values in production code - Fix errcheck: handle all error return values in test files - Fix staticcheck: replace deprecated WithCredentialsFile with WithAuthCredentialsFile - Remove unused code: authHeaders, planToEatPlannerItem, planToEatResponse - Use defer func() { _ = x.Close() }() pattern for ignored close errors Co-Authored-By: Claude Opus 4.5 --- internal/api/http.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/api/http.go') diff --git a/internal/api/http.go b/internal/api/http.go index 8854625..df28c65 100644 --- a/internal/api/http.go +++ b/internal/api/http.go @@ -95,7 +95,7 @@ func (c *BaseClient) PostEmpty(ctx context.Context, path string, headers map[str if err != nil { return fmt.Errorf("request failed: %w", err) } - defer resp.Body.Close() + defer func() { _ = resp.Body.Close() }() if resp.StatusCode < 200 || resp.StatusCode >= 300 { body, _ := io.ReadAll(resp.Body) @@ -126,7 +126,7 @@ func (c *BaseClient) doJSON(req *http.Request, result interface{}) error { if err != nil { return fmt.Errorf("request failed: %w", err) } - defer resp.Body.Close() + defer func() { _ = resp.Body.Close() }() if resp.StatusCode < 200 || resp.StatusCode >= 300 { body, _ := io.ReadAll(resp.Body) -- cgit v1.2.3