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/api/trello_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'internal/api/trello_test.go') 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() -- cgit v1.2.3