Skip to content

Commit 5725ef5

Browse files
ci: suppress SA5011 in test files (cache-masked nil-deref noise)
golangci's analysis cache was masking SA5011 false-positives in common's test files (the `got := f(); if got == nil { t.Fatalf }; got.X` pattern); the go1.25.11 toolchain bump busted the cache and reds lint on every PR. By-check _test.go suppression mirrors the api fix; production SA5011 still fails. Verified: full golangci-lint run ./... → 0 issues. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d384644 commit 5725ef5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.golangci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ linters:
2525
linters:
2626
- errcheck
2727
- gocyclo
28+
# SA5011 (possible nil pointer dereference) in test files fires on the
29+
# idiomatic `got := f(); if got == nil { t.Fatalf(...) }; got.X` pattern —
30+
# a nil deref in a test panics and fails loudly, so it carries no
31+
# production signal. Suppressed by-check in _test.go only; production
32+
# SA5011 still fails the build. golangci's analysis cache masks these
33+
# until a cache-busting change (e.g. a go.mod bump) re-analyses.
34+
- path: _test\.go
35+
linters:
36+
- staticcheck
37+
text: "SA5011"
2838

2939
issues:
3040
max-issues-per-linter: 0

0 commit comments

Comments
 (0)