Skip to content

fix(lint): suppress SA5011 in test files (mirror api .golangci.yml)#24

Merged
mastermanas805 merged 1 commit into
masterfrom
fix/golangci-sa5011-test-suppression-2026-06-04
Jun 3, 2026
Merged

fix(lint): suppress SA5011 in test files (mirror api .golangci.yml)#24
mastermanas805 merged 1 commit into
masterfrom
fix/golangci-sa5011-test-suppression-2026-06-04

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

What

cli lint reds on SA5011 (possible nil pointer dereference) in test filescmd/integration_test.go and internal/tokens/store_test.go — on the idiomatic got := f(); if got == nil { t.Fatalf(...) }; got.X pattern. golangci-lint runs with version: 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.go SA5011 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 wholesale staticcheck disable.

Memory ref: project_golangci_lint_cache_masks_sa5011.

🤖 Generated with Claude Code

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>
@mastermanas805 mastermanas805 enabled auto-merge (squash) June 3, 2026 22:21
@mastermanas805 mastermanas805 merged commit 725949d into master Jun 3, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant