You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
go list -m -json outputs multiple JSON documents when in a workspace, but gomoddirectives only decodes the first one. That can lead to golangci-lint wrongly complaining
WARN [linters_context] copyloopvar: this linter is disabled because the Go version (1.20) of your project is lower than Go 1.22
WARN [linters_context] intrange: this linter is disabled because the Go version (1.20) of your project is lower than Go 1.22
[x] Yes, I've included all the information above (version, config, etc.).
But you didn't provide the required minimal reproducible example or link to a public repository.
You can use the following option:
run:
go: '1.22'
ldez
changed the title
golangci-lint incorrectly complains about Go version being lower than needed
golangci-lint incorrectly complains about Go version being lower than needed (Go workspace)
Aug 8, 2024
$ mkdir golangci
$ cd golangci
$ go work init
$ mkdir a b
$ echo module a > a/go.mod
$ echo go 1.20 >> a/go.mod
$ echo module b > b/go.mod
$ echo go 1.22 >> b/go.mod
$ echo package main > b/main.go
$ go work use a
$ go work use b
$ cd b
$ golangci-lint run --enable=copyloopvar,intrange
WARN [linters_context] copyloopvar: this linter is disabled because the Go version (1.20) of your project is lower than Go 1.22
WARN [linters_context] intrange: this linter is disabled because the Go version (1.20) of your project is lower than Go 1.22
Welcome
typecheck
section of the FAQ.Description of the problem
go list -m -json
outputs multiple JSON documents when in a workspace, butgomoddirectives
only decodes the first one. That can lead togolangci-lint
wrongly complaininggolangci-lint/pkg/config/config.go
Line 79 in 90664f6
https://github.com/ldez/gomoddirectives/blob/7ed1901522539e1461a03c3237fba32af0f70523/module.go#L24-L33
Version of golangci-lint
Configuration
Go environment
Verbose output of running
A minimal reproducible example or link to a public repository
// add your code here
Validation
Supporter
The text was updated successfully, but these errors were encountered: