Skip to content

Commit e37763b

Browse files
committed
fix(lint): resolve pre-existing staticcheck findings
Unrelated to the zsh fix, but blocking this PR's CI: golangci-lint-action floats to the latest release, whose newer staticcheck catches issues that predate this PR and reproduce identically on main. - client_default.go: replace the deprecated http.Transport.Dial with DialContext (SA1019) - get.go: the unix build of GetAccentColor always errors, so the success path is statically unreachable there (SA4023), even though the darwin/windows implementations can succeed. An inline //nolint would be flagged as unused by nolintlint on those platforms' builds, so exclude SA4023 for this file via .golangci.yml instead - verified clean under GOOS=linux, GOOS=darwin, and GOOS=windows. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SAb3Bs4xBBQhweDvCh59b7
1 parent 03c9f96 commit e37763b

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/.golangci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ linters:
5757
- third_party$
5858
- builtin$
5959
- examples$
60+
rules:
61+
# GetAccentColor's unix stub (colors_unix.go) always errors, so staticcheck
62+
# sees the success path here as statically unreachable when analyzed under
63+
# a unix GOOS - even though the darwin/windows implementations can succeed.
64+
# An inline //nolint would be flagged as unused (nolintlint) on those
65+
# platforms' builds, so exclude by config instead.
66+
- path: cli/get.go
67+
linters:
68+
- staticcheck
69+
text: SA4023
6070
formatters:
6171
enable:
6272
- gofmt

src/runtime/http/client_default.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import (
1111

1212
var defaultTransport http.RoundTripper = &http.Transport{
1313
Proxy: http.ProxyFromEnvironment,
14-
Dial: (&net.Dialer{
14+
DialContext: (&net.Dialer{
1515
Timeout: 10 * time.Second,
16-
}).Dial,
16+
}).DialContext,
1717
TLSHandshakeTimeout: 10 * time.Second,
1818
ResponseHeaderTimeout: 10 * time.Second,
1919
}

0 commit comments

Comments
 (0)