Skip to content

Commit 338a39c

Browse files
committed
test: pass context.Background() instead of nil to LLM client
CI staticcheck flagged SA1012 — passing nil as a context argument, even where the function signature permits it, is a lint error. My local golangci-lint run was pulling a cached rule set that didn't enforce this; CI's fresh download did. Swap the two nil args in TestAnthropicClient_ModelManagementNotSupported for a shared context.Background(). No behavior change.
1 parent 89ecf99 commit 338a39c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

services/llm_client_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package services
22

33
import (
4+
"context"
45
"errors"
56
"strings"
67
"testing"
@@ -74,10 +75,11 @@ func TestNewLLMClient_Dispatch(t *testing.T) {
7475

7576
func TestAnthropicClient_ModelManagementNotSupported(t *testing.T) {
7677
c := newAnthropicClient("", "", "sk-test")
77-
if err := c.PullModel(nil, "anything", nil); !errors.Is(err, ErrModelManagementNotSupported) {
78+
ctx := context.Background()
79+
if err := c.PullModel(ctx, "anything", nil); !errors.Is(err, ErrModelManagementNotSupported) {
7880
t.Errorf("PullModel: want ErrModelManagementNotSupported, got %v", err)
7981
}
80-
if err := c.DeleteModel(nil, "anything"); !errors.Is(err, ErrModelManagementNotSupported) {
82+
if err := c.DeleteModel(ctx, "anything"); !errors.Is(err, ErrModelManagementNotSupported) {
8183
t.Errorf("DeleteModel: want ErrModelManagementNotSupported, got %v", err)
8284
}
8385
}

0 commit comments

Comments
 (0)