Skip to content

Commit

Permalink
golangci-lint: set go version to prevent fallback to go1.17
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
thaJeztah committed Nov 5, 2024
1 parent d77760f commit 4a7b04d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4a7b04d

Please sign in to comment.