Repository navigation
Migrate lint job to golangci-lint v2 - #112
Merged
Merged
Conversation
golangci-lint-action v9 refuses to install golangci-lint v1, so the lint job fails on every pull request with "golangci-lint v1 is not supported by golangci-lint-action >= v7". Bump the pinned version to v2.14.0 and add a v2 config that enables the std-error-handling exclusion preset. golangci-lint v1 applied those exclusions by default (unchecked Close, os.Remove, fmt.Fprint* and similar); v2 does not, which surfaces 33 errcheck findings against unchanged code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZrGfLRy5eYPy5v8JjKwrN
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.
Why
The
lintcheck fails on both open pull requests (#105, #109), and would fail on any new one:main):golangci-lint-action@v9refuses to install the pinnedv1.64.8— "golangci-lint v1 is not supported by golangci-lint-action >= v7".errcheckfindings. golangci-lint v1 excluded uncheckedClose,os.Remove(All),fmt.Fprint*and similar by default; v2 dropped those defaults.What
v2.14.0in.github/workflows/golangci-lint.yml..golangci.yml(v2 format) enabling thestd-error-handlingexclusion preset, which restores the v1 default behavior. No code changes.I chose the preset over sprinkling
_ =across 33 call sites (26 of themos.Removecleanup in tests): it keeps the lint bar exactly where it was before, with no diff noise. If you'd rather tighten errcheck later, removing the preset is a one-line change that deserves its own PR.Verification
Run locally with golangci-lint v2.14.0:
config verifypasses,golangci-lint run ./...reports 0 issues, andgofmt,go vet,go build, andgo test -raceare clean.After merging
mainmatches, or close it by hand.mainto pick up the fix.🤖 Generated with Claude Code
https://claude.ai/code/session_01AZrGfLRy5eYPy5v8JjKwrN
Generated by Claude Code