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/handlers/response.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/handlers/response.go') diff --git a/internal/handlers/response.go b/internal/handlers/response.go index 3976f02..9a7ab45 100644 --- a/internal/handlers/response.go +++ b/internal/handlers/response.go @@ -10,7 +10,7 @@ import ( // JSONResponse writes data as JSON with appropriate headers func JSONResponse(w http.ResponseWriter, data interface{}) { w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) + _ = json.NewEncoder(w).Encode(data) } // JSONError writes an error response as JSON @@ -32,5 +32,5 @@ func HTMLResponse(w http.ResponseWriter, tmpl *template.Template, name string, d // HTMLString writes an HTML string directly func HTMLString(w http.ResponseWriter, html string) { w.Header().Set("Content-Type", "text/html") - w.Write([]byte(html)) + _, _ = w.Write([]byte(html)) } -- cgit v1.2.3