Skip to content

Commit 6c5635a

Browse files
authored
Merge pull request #402 from dgageot/simpler-fetch-tests
Simpler fetch tests
2 parents 8e2e6a4 + 1ea163d commit 6c5635a

3 files changed

Lines changed: 88 additions & 194 deletions

File tree

.golangci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ linters:
2929
forbidigo:
3030
forbid:
3131
- pattern: context\.Background()
32+
msg: "do not use context.Background() in tests, use t.Context()"
33+
- pattern: context\.TODO()
34+
msg: "do not use context.TODO() in tests, use t.Context()"
3235
depguard:
3336
rules:
3437
internal:

pkg/tools/builtin/fetch.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ func (h *fetchHandler) CallTool(ctx context.Context, toolCall tools.ToolCall) (*
4747
Timeout: h.timeout,
4848
}
4949
if params.Timeout > 0 {
50-
timeout := time.Duration(params.Timeout) * time.Second
51-
client = &http.Client{Timeout: timeout}
50+
client.Timeout = time.Duration(params.Timeout) * time.Second
5251
}
5352

5453
var results []FetchResult

0 commit comments

Comments
 (0)