summaryrefslogtreecommitdiff
path: root/internal/api/http.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-01-25 20:55:58 -1000
committerPeter Stone <thepeterstone@gmail.com>2026-01-25 20:55:58 -1000
commitf5b997bfc4c77ef262726d14b30d387eb7acd1c6 (patch)
tree740879da10f3ddcd62bf276cd0632134b53a23c8 /internal/api/http.go
parentfa95c71494458070b78270e3d9170076028fc974 (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/api/http.go')
-rw-r--r--internal/api/http.go4
1 files changed, 2 insertions, 2 deletions
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)