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/handlers_test.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/handlers_test.go')
| -rw-r--r-- | internal/handlers/handlers_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/handlers/handlers_test.go b/internal/handlers/handlers_test.go index 3658e0e..d863546 100644 --- a/internal/handlers/handlers_test.go +++ b/internal/handlers/handlers_test.go @@ -26,7 +26,7 @@ func setupTestDB(t *testing.T) (*store.Store, func()) { if err != nil { t.Fatalf("Failed to create temp db: %v", err) } - tmpFile.Close() + _ = tmpFile.Close() // Save current directory and change to project root // This ensures migrations can be found @@ -43,18 +43,18 @@ func setupTestDB(t *testing.T) (*store.Store, func()) { // Initialize store (this runs migrations) db, err := store.New(tmpFile.Name(), "migrations") if err != nil { - os.Chdir(originalDir) - os.Remove(tmpFile.Name()) + _ = os.Chdir(originalDir) + _ = os.Remove(tmpFile.Name()) t.Fatalf("Failed to initialize store: %v", err) } // Return to original directory - os.Chdir(originalDir) + _ = os.Chdir(originalDir) // Return cleanup function cleanup := func() { - db.Close() - os.Remove(tmpFile.Name()) + _ = db.Close() + _ = os.Remove(tmpFile.Name()) } return db, cleanup |
