lint: enable 14 new linters, bump golangci-lint-action to v9.3.0 - #10
Merged
Conversation
Assisted-By: Claude
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.
Keeping the linter configuration up-to-date catches more bugs statically and reduces review noise over time. This commit enables 14 linters that were available but not yet turned on, and bumps the CI action that runs them.
The new linters cover a broad range of concerns: duplicate words in comments (
dupword), misused embedded struct fields (embeddedstructfieldcheck), JSON error-checking gaps (errchkjson), incompleteswitch/selectcoverage (exhaustive), unchecked type assertions (forcetypeassert), comment punctuation (godot), security patterns (gosec), interface ambiguities (iface), nil-return bugs (nilerr,nilnesserr,nilnil), incorrectly constructed host:port strings (nosprintfhostport), receiver inconsistencies (recvcheck), and missingt.Parallel()calls in subtests (tparallel).gosecrequired a small set of targeted//nolintexclusions:G103covers the deliberate unsafe zero-copy inFindBytes/ContainsBytes(documented at the call sites),G115covers integer conversions that are bounds-checked by construction, andG304covers the scanner's intentional opening of user-supplied paths.gosecis also suppressed on_test.gofiles because tests hardcode fake credentials by design. Two candidates —makezeroandprealloc— were evaluated but dropped because every finding was a false positive on intentionally index-filled slices.golangci-lint-actionis bumped from v9.2.0 to v9.3.0 (SHA-pinned); the linter binary itself was already at the latest v2.12.2 and needed no change.No production behaviour changes. The only code edits are the
//nolintannotations that silence the three deliberategosecpatterns described above.