-
Welcome
How did you install golangci-lint?Official binary Description of the problemAfter trying to upgrade to Go 1.24, I get lots of Some of the errors all look like this:
Version of golangci-lint$ golangci-lint --version
golangci-lint has version 1.64.8 built with go1.24.1 from 8b37f141 on 2025-03-17T20:41:53Z ConfigurationI reproduce this even without a configuration file Go environment$ go version && go env
go version go1.24.1 linux/amd64
AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN='/home/gregoire/.local/share/mise/installs/go/1.24.1/bin'
GOCACHE='/home/gregoire/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/gregoire/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2484409792=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/tmp/pwet/go.mod'
GOMODCACHE='/home/gregoire/dev/go/pkg/mod'
GONOPROXY='git.manomano.tech'
GONOSUMDB='git.manomano.tech'
GOOS='linux'
GOPATH='/home/gregoire/dev/go'
GOPRIVATE='git.manomano.tech'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/gregoire/.local/share/mise/installs/go/1.24.1'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/gregoire/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/gregoire/.local/share/mise/installs/go/1.24.1/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.24.1'
GOWORK=''
PKG_CONFIG='pkg-config' Verbose output of running$ golangci-lint cache clean
$ golangci-lint run -v
INFO golangci-lint has version 1.64.8 built with go1.24.1 from 8b37f141 on 2025-03-17T20:41:53Z
INFO [config_reader] Config search paths: [./ /tmp/pwet /tmp / /home/gregoire]
INFO [config_reader] Used config file ../.golangci.yml
INFO [goenv] Read go env for 2.772847ms: map[string]string{"GOCACHE":"/home/gregoire/.cache/go-build", "GOROOT":"/home/gregoire/.local/share/mise/installs/go/1.24.1"}
INFO [lintersdb] Active 0 linters: []
INFO [loader] Go packages loading at mode 8199 (compiled_files|files|name) took 54.727854ms
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 109.796µs
INFO [linters_context/goanalysis] analyzers took 19.467µs with top 10 stages: typecheck: 19.467µs
INFO [runner/exclusion_rules] Skipped 0 issues by rules: [Source: "(?i)^\t[a-zA-Z0-9]+ +[a-zA-Z0-9]+ +`.+`$", Linters: "lll"]
INFO [runner/exclusion_rules] Skipped 0 issues by rules: [Source: "(?i)^// ", Linters: "lll"]
INFO [runner/exclusion_rules] Skipped 0 issues by rules: [Path: "_test\\.go", Linters: "goconst, funlen, gocognit, gocyclo, dupl, dogsled, maintidx, gochecknoglobals, mnd, varnamelen"]
INFO [runner/exclusion_rules] Skipped 0 issues by rules: [Source: "(?i)defer", Linters: "errcheck"]
INFO [runner/exclusion_rules] Skipped 0 issues by rules: [Text: "(?i)Example", Linters: "nosnakecase"]
INFO [runner/exclusion_rules] Skipped 0 issues by rules: [Source: "(?i)^// @", Linters: "lll"]
INFO [runner] Processors filtering stat (in/out): filename_unadjuster: 1/1, generated_file_filter: 1/1, diff: 1/1, fixer: 1/1, source_code: 1/1, path_prettifier: 1/1, exclusion_paths: 1/1, skip_dirs: 1/1, exclusion_rules: 1/1, max_same_issues: 1/1, max_from_linter: 1/1, path_shortener: 1/1, severity-rules: 1/1, cgo: 1/1, invalid_issue: 1/1, skip_files: 1/1, identifier_marker: 1/1, nolint_filter: 1/1, path_absoluter: 1/1, path_relativity: 1/1, uniq_by_line: 1/1, max_per_file_from_linter: 1/1, sort_results: 1/1
INFO [runner] processing took 45.397µs with stages: exclusion_rules: 25.318µs, source_code: 13.176µs, uniq_by_line: 922ns, path_relativity: 821ns, invalid_issue: 591ns, path_shortener: 551ns, severity-rules: 451ns, nolint_filter: 441ns, max_same_issues: 401ns, cgo: 330ns, sort_results: 321ns, exclusion_paths: 251ns, diff: 241ns, filename_unadjuster: 210ns, skip_dirs: 201ns, path_absoluter: 200ns, identifier_marker: 190ns, max_per_file_from_linter: 180ns, path_prettifier: 140ns, generated_file_filter: 140ns, max_from_linter: 130ns, fixer: 111ns, skip_files: 80ns
INFO [runner] linters took 296.126µs with stages: typecheck: 213.451µs
main.go:3:8: could not import fmt (Config.Importer.Import(fmt) returned nil but no error) (typecheck)
import "fmt"
^
INFO File cache stats: 1 entries of total size 74B
INFO Memory: 2 samples, avg is 35.6MB, max is 35.6MB
INFO Execution took 58.42613ms
A minimal reproducible example or link to a public repositorypackage main
import "fmt"
func main() {
fmt.Println("Hello, World!")
} Validation
Supporter
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 5 replies
-
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
Beta Was this translation helpful? Give feedback.
-
Hello, can you provide a reproducible example? |
Beta Was this translation helpful? Give feedback.
-
Hello, I managed to reproduce this in a |
Beta Was this translation helpful? Give feedback.
-
Your example works without any problem, so the problem is related to your environment:
I base64 encoded your example for simplicity. $ docker run -it --rm golangci/golangci-lint:v1.64.8 bash
root@03bf8d9c3c96:/go# mkdir /tmp/pwet && cd $_
root@03bf8d9c3c96:/tmp/pwet# go mod init example.com/pwet
go: creating new go.mod: module example.com/pwet
root@03bf8d9c3c96:/tmp/pwet# echo cGFja2FnZSBtYWluCgppbXBvcnQgImZtdCIKCmZ1bmMgbWFpbigpIHsKCWZtdC5QcmludGxuKCJIZWxsbywgV29ybGQhIikKfQo= | base64 -d > main.go
root@03bf8d9c3c96:/tmp/pwet# golangci-lint run -v
INFO golangci-lint has version 1.64.8 built with go1.24.1 from 8b37f141 on 2025-03-17T20:41:53Z
INFO [config_reader] Config search paths: [./ /tmp/pwet /tmp / /root]
INFO [goenv] Read go env for 2.334116ms: map[string]string{"GOCACHE":"/root/.cache/go-build", "GOROOT":"/usr/local/go"}
INFO [lintersdb] Active 6 linters: [errcheck gosimple govet ineffassign staticcheck unused]
INFO [loader] Go packages loading at mode 8767 (types_sizes|compiled_files|deps|files|exports_file|imports|name) took 2.119741266s
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 111.259µs
INFO [linters_context/goanalysis] analyzers took 768.303385ms with top 10 stages: buildir: 612.854793ms, inspect: 25.182865ms, SA5012: 23.397049ms, printf: 23.243183ms, ctrlflow: 18.897558ms, fact_deprecated: 18.18241ms, fact_purity: 15.838935ms, nilness: 11.872478ms, typedness: 11.134254ms, tokenfileanalyzer: 6.328872ms
INFO [runner] processing took 2.916µs with stages: filename_unadjuster: 497ns, max_same_issues: 276ns, exclusion_rules: 238ns, skip_dirs: 223ns, path_absoluter: 217ns, nolint_filter: 160ns, exclusion_paths: 160ns, skip_files: 124ns, path_relativity: 118ns, source_code: 117ns, max_per_file_from_linter: 115ns, path_shortener: 113ns, sort_results: 113ns, diff: 102ns, max_from_linter: 77ns, fixer: 38ns, uniq_by_line: 36ns, invalid_issue: 35ns, generated_file_filter: 34ns, cgo: 34ns, path_prettifier: 32ns, severity-rules: 29ns, identifier_marker: 28ns
INFO [runner] linters took 559.108298ms with stages: goanalysis_metalinter: 559.085752ms
INFO File cache stats: 0 entries of total size 0B
INFO Memory: 28 samples, avg is 70.6MB, max is 281.5MB
INFO Execution took 2.681947879s
root@03bf8d9c3c96:/tmp/pwet# |
Beta Was this translation helpful? Give feedback.
-
I usually use |
Beta Was this translation helpful? Give feedback.
-
🤔 after a reboot I no longer have the error in the small reproducer. Then when I use mise-en-place in the small reproducer, I get weird stuff like this:
I was going to say it had to do with mise, but then I reproduce the original error on my company project in the CI, and the CI does not use mise yet. I am perplexed. |
Beta Was this translation helpful? Give feedback.
I fixed my issue, I'm not even sure how, but if I remember properly, it involved removing the configuration file, running the tool, then restoring the configuration file. I've done many things aside from this, so I'm not even sure it's related to that. In any case, thanks for your answers and congrats on 2.0.0!