From 8ea5b3350d1acb98eac24c7933a1d42583189e18 Mon Sep 17 00:00:00 2001 From: Chris Burns <29541485+ChrisJBurns@users.noreply.github.com> Date: Sun, 3 May 2026 17:15:21 +0100 Subject: [PATCH] ci: adopt golangci-lint v2.12.1 and exclude goconst from tests Pin golangci-lint to v2.12.1 in the lint workflow. The action was unpinned and auto-installing the latest binary, which could break main when v2.12.1 shipped with stricter goconst defaults. Exclude goconst from (.+)_test\.go in .golangci.yml. Test fixtures legitimately repeat literals like "Hello, World!" and "test-agent"; forcing constants there adds noise without value, and matches the existing test-file exclusions for lll, gocyclo, errcheck, dupl, gosec, paralleltest. Verified locally with golangci-lint v2.12.1: 0 issues. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/lint.yml | 1 + .golangci.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 317a54d..1636731 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,4 +22,5 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 with: + version: v2.12.1 args: --timeout=5m \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml index 3d93bad..1f2821b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -79,6 +79,7 @@ linters: - errcheck - dupl - gosec + - goconst - paralleltest path: (.+)_test\.go - linters: