From 7b930a599d531c565d4fab1edb07f606d55a1dd6 Mon Sep 17 00:00:00 2001 From: Maximilian Geberl Date: Fri, 8 May 2026 07:19:39 +0200 Subject: [PATCH 1/3] Pin golangci-lint version --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2aeadd5..341b265 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,8 @@ jobs: run: go mod tidy && git diff --no-patch --exit-code - name: Golangci-lint uses: golangci/golangci-lint-action@v9.2.0 + with: + version: v2.12.2 - name: Run unit tests run: go test ./... - name: GoReleaser Build Snapshot From 6413460b1ea9d4be40d0cdb27e23981e344d4cb8 Mon Sep 17 00:00:00 2001 From: Maximilian Geberl Date: Fri, 8 May 2026 07:20:04 +0200 Subject: [PATCH 2/3] configure goconst --- .golangci.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.golangci.yaml b/.golangci.yaml index 6dfe558..6713383 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -13,6 +13,13 @@ linters: - unparam disable: - errcheck + settings: + goconst: + min-len: 2 + min-occurrences: 5 + ignore-string-values: + - 'true' + - 'false' exclusions: generated: lax presets: From 2033b88b82cc763e5770d133353ff3b82f485ec2 Mon Sep 17 00:00:00 2001 From: Maximilian Geberl Date: Fri, 8 May 2026 07:20:18 +0200 Subject: [PATCH 3/3] Add nolint in a test --- internal/filter/filter_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/filter/filter_test.go b/internal/filter/filter_test.go index 87852e8..f7a02e2 100644 --- a/internal/filter/filter_test.go +++ b/internal/filter/filter_test.go @@ -52,7 +52,7 @@ func TestFilterByPredicate(t *testing.T) { newFakeObj("o2", now.Add(-120*time.Second)), }), givenMaxAge: "119s", - expectedNames: []string{"o1"}, + expectedNames: []string{"o1"}, // nolint: goconst // not relevant for a const }, { name: "two objects, both too old",