$ golangci-lint cache clean
$ golangci-lint run --enable nolintlint --enable lll --fix test.go -v
INFO golangci-lint has version 2.11.4 built with go1.26.1 from 8f3b0c7e on 2026-03-22T17:35:14Z
INFO [config_reader] Config search paths: [./ /tmp / /root]
INFO [goenv] Read go env for 2.543754ms: map[string]string{"GOCACHE":"/root/.cache/go-build", "GOROOT":"/usr/local/go"}
INFO [lintersdb] Active 7 linters: [errcheck govet ineffassign lll nolintlint staticcheck unused]
INFO [loader] Go packages loading at mode 8767 (deps|files|imports|compiled_files|exports_file|name|types_sizes) took 42.282407ms
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 220.422µs
INFO [linters_context/goanalysis] analyzers took 7.177003ms with top 10 stages: buildir: 711.717µs, nolintlint: 664.725µs, inspect: 664.373µs, fact_deprecated: 537.895µs, errcheck: 436.904µs, printf: 276.505µs, ctrlflow: 265.795µs, unused: 263.993µs, fact_purity: 171.508µs, SA5012: 166.244µs
INFO [runner] Applying suggested fixes
INFO [runner] fixer took 155.617µs with stages: all: 155.617µs
INFO [runner] Issues before processing: 1, after processing: 0
INFO [runner] Processors filtering stat (in/out): invalid_issue: 1/1, path_relativity: 1/1, exclusion_rules: 1/1, cgo: 1/1, generated_file_filter: 1/1, diff: 1/1, exclusion_paths: 1/1, nolint_filter: 1/1, fixer: 1/0, path_absoluter: 1/1, filename_unadjuster: 1/1
INFO [runner] processing took 281.745µs with stages: fixer: 178.239µs, nolint_filter: 53.402µs, generated_file_filter: 36.753µs, uniq_by_line: 6.083µs, sort_results: 1.124µs, path_relativity: 1.079µs, max_same_issues: 652ns, invalid_issue: 583ns, exclusion_paths: 581ns, cgo: 463ns, max_per_file_from_linter: 451ns, filename_unadjuster: 441ns, diff: 388ns, exclusion_rules: 341ns, max_from_linter: 285ns, path_absoluter: 256ns, path_prettifier: 246ns, path_shortener: 142ns, source_code: 132ns, severity-rules: 104ns
INFO [runner] linters took 7.269685ms with stages: goanalysis_metalinter: 6.909687ms
0 issues.
INFO File cache stats: 1 entries of total size 81B
INFO Memory: 2 samples, avg is 41.2MB, max is 43.2MB
INFO Execution took 52.832396ms
Welcome
typechecksection of the FAQ.How did you install golangci-lint?
Official binary
Description of the problem
When nolintlint removes unnecessary
//nolintcomment from a docstring, that docstring becomes separated from its target.Version of golangci-lint
Details
Configuration
Details
golangci-lint run --enable nolintlint --enable lll --fix test.goGo environment
Details
Verbose output of running
Details
A minimal reproducible example or link to a public repository
Details
If I have Go file
test.go:And I run
golangci-lint run --enable nolintlint --enable lll --fix test.go, I get the following:Because of an empty line, now this comment is not a docstring comment. So for example, then another linter like
revivestarts complaining that a docstring is missing for public struct. I think linter should in this case convert to:Or at least to:
Validation
Supporter