From 74dfd93f2356b6a0d9f1fb7ff690ff58adb39081 Mon Sep 17 00:00:00 2001 From: Andrew Nesbitt Date: Fri, 22 May 2026 11:34:36 +0100 Subject: [PATCH] Set goconst to ignore test files Path exclusions only filter where goconst issues are reported, not which files contribute to the occurrence count, so a string used once in production code and twice in tests still gets flagged. The `ignore-tests` setting makes goconst skip test files entirely. --- .golangci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 37f74c1..f60442a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -16,6 +16,9 @@ linters: - ireturn - goconst - errcheck + settings: + goconst: + ignore-tests: true exclusions: rules: - path: _test\.go