$ golangci-lint cache clean
!!! This fixes the problem
$ golangci-lint run -v
INFO golangci-lint has version v1.64.8 built with go1.23.8 from (unknown, modified: ?, mod sum: "h1:y5TdeVidMtBGG32zgSC7ZXTFNHrsJkDnpO4ItB3Am+I=") on (unknown)
INFO [config_reader] Config search paths: [...]
INFO [config_reader] Used config file ./.golangci.yml
INFO [goenv] Read go env for 7.515976ms: map[string]string{"GOCACHE":"/home/.../.cache/go-build", "GOROOT":"/home/.../.gvm/gos/go1.23.8"}
INFO [lintersdb] Active 31 linters: [asciicheck bidichk bodyclose copyloopvar dogsled errcheck errname gocognit goconst gocritic gocyclo gofmt goimports gomoddirectives gosec gosimple govet ineffassign misspell mnd nilerr noctx prealloc predeclared revive staticcheck stylecheck unconvert unparam unused whitespace]
INFO [loader] Go packages loading at mode 8767 (compiled_files|files|name|types_sizes|deps|exports_file|imports) took 1.048974991s
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 236.333271ms
INFO [linters_context/goanalysis] analyzers took 0s with no stages
INFO [runner] Applying suggested fixes
INFO [runner] fixer took 470ns with stages: all: 470ns
INFO [runner/exclusion_rules] Skipped 5 issues by rules: [Path: "_test\\.go$", Linters: "gosec, goconst, mnd"]
INFO [runner/exclusion_rules] Skipped 45 issues by rules: [Path: "^(.*/)?(integration_)?test/", Linters: "gosec, goconst, mnd"]
INFO [runner] Issues before processing: 3728, after processing: 0
INFO [runner] Processors filtering stat (in/out): skip_dirs: 2653/2653, identifier_marker: 2266/2266, exclusion_rules: 2266/74, path_absoluter: 3728/3728, skip_files: 3728/2653, invalid_issue: 3728/3728, exclusion_paths: 3728/3728, cgo: 3728/3728, filename_unadjuster: 3728/3728, path_relativity: 3728/3728, nolint_filter: 74/0, generated_file_filter: 2653/2266
INFO [runner] processing took 70.062434ms with stages: nolint_filter: 28.973133ms, exclusion_rules: 17.699448ms, generated_file_filter: 11.38701ms, path_relativity: 4.214477ms, skip_dirs: 3.822557ms, skip_files: 1.300504ms, invalid_issue: 927.637µs, filename_unadjuster: 909.179µs, identifier_marker: 409.35µs, cgo: 216.513µs, path_absoluter: 167.033µs, fixer: 32.391µs, max_same_issues: 535ns, max_from_linter: 469ns, exclusion_paths: 450ns, sort_results: 336ns, uniq_by_line: 292ns, diff: 290ns, source_code: 290ns, path_shortener: 221ns, max_per_file_from_linter: 114ns, severity-rules: 103ns, path_prettifier: 102ns
INFO [runner] linters took 927.928914ms with stages: goanalysis_metalinter: 857.6949ms
INFO File cache stats: 0 entries of total size 0B
INFO Memory: 24 samples, avg is 66.5MB, max is 104.5MB
INFO Execution took 2.218360717s
Welcome
typechecksection of the FAQ.How did you install golangci-lint?
go install
Description of the problem
I had 'replace' directive in the go.mod file. Linter complained with gomoddirectives error on line 127. I removed this line. But linter continues to complain.
But there is no line 127 at all in the go.mod file anymore.
If I switch to another git branch the error disappears. If I switch back to the original branch the error returns back too.
The problem can be solved with command
From this I can conclude that linter takes go.mod file from cache even after its modification.
The problem arises not permanently. I saw it second time during 4 months.
P.S. I used jetbrains GoLand 2024.3.5 to edit go.mod file. Maybe it matters.
Version of golangci-lint
Details
Configuration
Details
Go environment
Details
Verbose output of running
Details
A minimal reproducible example or link to a public repository
Details
go.mod:This line deleted
Validation
Supporter