diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-25 20:55:58 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-25 20:55:58 -1000 |
| commit | f5b997bfc4c77ef262726d14b30d387eb7acd1c6 (patch) | |
| tree | 740879da10f3ddcd62bf276cd0632134b53a23c8 /internal/handlers/response.go | |
| parent | fa95c71494458070b78270e3d9170076028fc974 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'internal/handlers/response.go')
| -rw-r--r-- | internal/handlers/response.go | 4 |
1 files changed, 2 insertions, 2 deletions
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)) } |
