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/api/trello_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/api/trello_test.go')
| -rw-r--r-- | internal/api/trello_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/api/trello_test.go b/internal/api/trello_test.go index 7433ff0..d677363 100644 --- a/internal/api/trello_test.go +++ b/internal/api/trello_test.go @@ -15,7 +15,7 @@ import ( // newTestTrelloClient creates a TrelloClient for testing with custom base URL func newTestTrelloClient(baseURL, apiKey, token string) *TrelloClient { client := NewTrelloClient(apiKey, token) - client.BaseClient.BaseURL = baseURL + client.BaseURL = baseURL return client } @@ -67,7 +67,7 @@ func TestTrelloClient_CreateCard(t *testing.T) { } w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(response) + _ = json.NewEncoder(w).Encode(response) })) defer server.Close() @@ -122,7 +122,7 @@ func TestTrelloClient_CreateCard_WithDueDate(t *testing.T) { } w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(response) + _ = json.NewEncoder(w).Encode(response) })) defer server.Close() @@ -176,7 +176,7 @@ func TestTrelloClient_UpdateCard(t *testing.T) { // Return 200 OK w.WriteHeader(http.StatusOK) - w.Write([]byte(`{"id":"card-123","name":"Updated Name"}`)) + _, _ = w.Write([]byte(`{"id":"card-123","name":"Updated Name"}`)) })) defer server.Close() @@ -201,7 +201,7 @@ func TestTrelloClient_UpdateCard_Error(t *testing.T) { // Mock server that returns error server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusBadRequest) - w.Write([]byte(`{"error":"Invalid card ID"}`)) + _, _ = w.Write([]byte(`{"error":"Invalid card ID"}`)) })) defer server.Close() |
