chore: upgrade golangci-lint from v1.64.8 to v2.1.6 and the related action from v6 to v8 #1160
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.
Overview
This pull request addresses issues related to #1153 in which the GitHub action related to golangci-lint needed to be upgraded from v6 to v8. This upgrade requires golangci-lint itself to be updated from v1.64.8 (what was used) to anything v2.X.X. The latest version at the time of this PR is v2.1.6 so that is what was upgraded to in the GitHub action.
Migration to
golangci-lintv2.1.6Because of the major version bump the current
.golangci.ymlconfig for the linter needed to be adjusted. The CLI tool offered amigratecommand to help make this effort easier. However there were some side effects:run.timeoutwas the only thing effected, it was ignored because there is no default in v2 (added it back in with 5 minutes because that is what is used in the GitHub action)With this migration complete, the
golangci/golangci-lint-actioninci-tests.yamlwas able to be updated from v6 to v8.Edits to Code Based on New Rules
In the updated version of the linter there were a few new rules added that required the code to be updated. The updates included the following things:
.Write(..)was converted to usefmt.Fprintf()instead