From 3c1d213e955c63f3dfa27c158bbc125215b75947 Mon Sep 17 00:00:00 2001 From: awalsh128 Date: Wed, 21 Oct 2026 12:59:39 -0700 Subject: [PATCH] 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 --- .github/workflows/pull_request.yml | 2 +- .golangci.yml | 10 ++++++++++ src/internal/cmdtesting/cmdtesting.go | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .golangci.yml diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 802865f..e837bac 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -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 diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..9c585f7 --- /dev/null +++ b/.golangci.yml @@ -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 diff --git a/src/internal/cmdtesting/cmdtesting.go b/src/internal/cmdtesting/cmdtesting.go index 4b6555c..afebbbe 100644 --- a/src/internal/cmdtesting/cmdtesting.go +++ b/src/internal/cmdtesting/cmdtesting.go @@ -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()) } }