fix(lint): resolve golangci-lint v2.11.4 errors#1338
Open
IfSentient wants to merge 1 commit intomainfrom
Open
Conversation
Fixes deprecatedComment, gosec, prealloc, revive (use-slices-sort), and staticcheck issues introduced by the upgrade from golangci-lint v2.5.0 to v2.11.4. Updates linter version in Makefile and CI workflow. Co-Authored-By: Claude Sonnet 4.6 <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 Changed? Why?
Follow-up to #1337, reverts the linter back to
2.11.4, but also bumps the action's linter version to2.11.4to ensure that PR linter checks match the localmake lint.Upgrades golangci-lint from v2.5.0 to v2.11.4 in the Makefile and CI workflow, and fixes all new linter errors introduced by the upgrade across 26 files.
The new linter version introduced stricter checks for:
deprecatedComment(Deprecated notices must be in a separate paragraph),gosec(G115/G118/G122),prealloc(slice capacity hints),revive(use-slices-sort— replacesort.Slice/sort.Stringswithslices.SortFunc/slices.Sort), andstaticcheck(QF1012 — preferfmt.FprintfoverWriteString(fmt.Sprintf(...))).How was it tested?
make lintreports 0 issues.make testpasses for all packages.Where did you document your changes?
No documentation changes required; all changes are code/comment fixes to satisfy the linter.
Notes to Reviewers
Most changes are mechanical: blank lines before
// Deprecated:comments,//nolint:directives where fixes would be counterproductive (e.g. calling a function twice just to preallocate), and replacingsortpackage calls withslicesequivalents.