Commit 71b49e7
authored
## Summary
Removes the \`HTTPClient\` field from \`ClientConfig\`. The field was
declared in [#681](#681) but
never read by \`createHTTPClient\` or \`NewClientWithConfig\` — a caller
setting \`cfg.HTTPClient = someClient\` got the auto-constructed
transport instead of theirs.
A repo-wide grep confirms zero field-access or struct-literal callers in
production code or tests. Only the function name \`createHTTPClient\`
and the local variable \`httpClient\` turn up in matches; the field
itself has no readers.
Closes [#684](#684).
## Design choice
The [issue](#684) presented
two options:
1. **Honor the field** — useful as a testing seam (inject fake
transport).
2. **Remove the field** — more honest about current code.
**Chose Option 2** because:
- Zero current callers in tests or production — the field is genuinely
vestigial.
- The equivalent test-seam pattern (\`SetTransportFactoryForTest\`)
already exists in \`middlewares/webhook.go\` where it's actually needed.
- Honoring the field would also require running
\`disableHTTP2AutoConfig\` on caller-supplied transports when the scheme
is non-TLS (the #668 invariant), expanding scope significantly for a
field nobody uses.
- If a future contributor needs a transport-level injection seam, they
can add it with a clear use case spelled out — better than reviving a
vestigial field.
## Test plan
- [x] \`go test ./...\` passes (full repo, 14 packages, ~56s)
- [x] \`golangci-lint run\` clean
- [x] \`go vet ./...\` clean
- [ ] CI green
2 files changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | 193 | | |
197 | 194 | | |
198 | 195 | | |
| |||
0 commit comments