From 4a7b04d4127c6082a9e8de95cfce6f34744d8fc1 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 5 Nov 2024 10:13:58 +0100 Subject: [PATCH] golangci-lint: set go version to prevent fallback to go1.17 GolangCI-lint attempts to deduct the Go version to lint for through the go version specified in go.mod, which we don't have, and therefore it falls back to go1.17 semantics: level=warning msg="[linters_context] copyloopvar: this linter is disabled because the Go version (1.17) of your project is lower than Go 1.22 Signed-off-by: Sebastiaan van Stijn --- .golangci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index ff727b8c5e..96ec177253 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -41,6 +41,9 @@ linters: - errcheck run: + # prevent golangci-lint from deducting the go version to lint for through go.mod, + # which causes it to fallback to go1.17 semantics. + go: "1.23.2" timeout: 5m linters-settings: