fix(lint): suppress SA5011 in test files (mirror api .golangci.yml)#24
Merged
mastermanas805 merged 1 commit intoJun 3, 2026
Merged
Conversation
golangci-lint runs with version:latest, so a newer staticcheck (2.12.2)
now flags SA5011 (possible nil pointer dereference) on the idiomatic
`got := f(); if got == nil { t.Fatalf(...) }; got.X` test pattern in
cmd/integration_test.go and internal/tokens/store_test.go. A nil deref in
a test panics and fails the test loudly — benign test noise, not a
production-safety signal. This reds lint on master (and every PR) on a
fresh run, independent of any code change.
Add the by-check `_test.go` SA5011 exclusion the api repo already carries
(see memory project_golangci_lint_cache_masks_sa5011). Production SA5011
still fails the build — scoped to tests only, not a wholesale staticcheck
disable. Unblocks the stuck dependabot actions-bump PR #22 and any future
cli PR.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
cli
lintreds onSA5011(possible nil pointer dereference) in test files —cmd/integration_test.goandinternal/tokens/store_test.go— on the idiomaticgot := f(); if got == nil { t.Fatalf(...) }; got.Xpattern. golangci-lint runs withversion: latest, so a newer staticcheck (2.12.2) surfaces these on previously-clean test files. It reds master and every PR on a fresh run, independent of any code change — and is currently blocking the Dependabot actions-bump PR #22 (whose own diff only bumps 3 action versions).Fix
Add the by-check
_test.goSA5011 exclusion the api repo already carries. A nil deref in a test panics and fails the test loudly, so this is benign test noise, not a production-safety signal. Production SA5011 still fails the build — scoped to tests only, not a wholesalestaticcheckdisable.Memory ref:
project_golangci_lint_cache_masks_sa5011.🤖 Generated with Claude Code