Upgrade golangci-lint to v2 for golangci-lint-action v9

golangci-lint-action >= v7 rejects golangci-lint v1, so the Lint step
failed before installing. Move to golangci-lint v2.14.0 and add a v2
config that keeps the default exclusions v1 applied implicitly. Fix the
one new staticcheck QF1008 finding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
awalsh128 2026-10-21 12:59:39 -07:00
parent 438c39d8e6
commit 3c1d213e95
3 changed files with 12 additions and 2 deletions

View file

@ -26,4 +26,4 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@d583c34f0599d37dbac4a198b9c83201be380893 # v9.3.0
with:
version: v1.52.2
version: v2.14.0

10
.golangci.yml Normal file
View file

@ -0,0 +1,10 @@
version: "2"
linters:
exclusions:
# Keep the default exclusions that golangci-lint v1 applied implicitly.
presets:
- comments
- common-false-positives
- legacy
- std-error-handling

View file

@ -55,7 +55,7 @@ func (t *CmdTesting) Run(command string, pkgNames ...string) RunResult {
if t.createReplayLogs {
err := common.AppendFile(binaryName+".log", t.replayFilename)
if err != nil {
t.T.Fatalf("Error encountered appending log file.\n%s", err.Error())
t.Fatalf("Error encountered appending log file.\n%s", err.Error())
}
}