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 version && go envgo version go1.24.1 linux/amd64AR='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='on'GOAMD64='v1'GOARCH='amd64'GOAUTH='netrc'GOBIN=''GOCACHE='/home/kk/.cache/go-build'GOCACHEPROG=''GODEBUG=''GOENV='/home/kk/.config/go/env'GOEXE=''GOEXPERIMENT=''GOFIPS140='off'GOFLAGS=''GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4256416931=/tmp/go-build -gno-record-gcc-switches'GOHOSTARCH='amd64'GOHOSTOS='linux'GOINSECURE=''GOMOD='/home/kk/projects/misc/tinysa/go-tinysa/go.mod'GOMODCACHE='/home/kk/go/pkg/mod'GONOPROXY=''GONOSUMDB=''GOOS='linux'GOPATH='/home/kk/go'GOPRIVATE=''GOPROXY='https://proxy.golang.org,direct'GOROOT='/usr/local/go'GOSUMDB='sum.golang.org'GOTELEMETRY='local'GOTELEMETRYDIR='/home/kk/.config/go/telemetry'GOTMPDIR=''GOTOOLCHAIN='auto'GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'GOVCS=''GOVERSION='go1.24.1'GOWORK=''PKG_CONFIG='pkg-config'
Verbose output of running
Without revive settings:
$ golangci-lint cache clean
$ golangci-lint run -vINFO golangci-lint has version 2.1.2 built with go1.24.2 from 00a561d9 on 2025-04-15T13:26:47Z INFO [config_reader] Config search paths: [./ /home/kk/projects/misc/tinysa/go-tinysa /home/kk/projects/misc/tinysa /home/kk/projects/misc /home/kk/projects /home/kk /home /] INFO [config_reader] Used config file .golangci.yml INFO maxprocs: Leaving GOMAXPROCS=16: CPU quota undefined INFO [goenv] Read go env for 2.830929ms: map[string]string{"GOCACHE":"/home/kk/.cache/go-build", "GOROOT":"/usr/local/go"} INFO [lintersdb] Active 1 linters: [revive] INFO [loader] Go packages loading at mode 8199 (compiled_files|files|name) took 75.45262ms INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 2.053424ms INFO [linters_context/goanalysis] analyzers took 908.594413ms with top 10 stages: the_only_name: 908.511028ms, typecheck: 83.385µs INFO [runner/max_same_issues] 4/7 issues with text "package-comments: should have a package comment" were hidden, use --max-same-issues INFO [runner] Issues before processing: 16, after processing: 12 INFO [runner] Processors filtering stat (in/out): exclusion_paths: 16/16, nolint_filter: 16/16, uniq_by_line: 16/16, max_per_file_from_linter: 16/16, source_code: 12/12, path_shortener: 12/12, severity-rules: 12/12, path_prettifier: 12/12, sort_results: 12/12, cgo: 16/16, filename_unadjuster: 16/16, path_relativity: 16/16, generated_file_filter: 16/16, exclusion_rules: 16/16, max_same_issues: 16/12, max_from_linter: 12/12, diff: 16/16, fixer: 16/16, path_absoluter: 16/16, invalid_issue: 16/16 INFO [runner] processing took 580.117µs with stages: nolint_filter: 329.487µs, generated_file_filter: 120.786µs, source_code: 58.55µs, max_same_issues: 18.716µs, sort_results: 9.608µs, path_relativity: 9.026µs, uniq_by_line: 8.325µs, invalid_issue: 5.12µs, cgo: 4.94µs, max_from_linter: 3.466µs, path_prettifier: 2.956µs, max_per_file_from_linter: 2.755µs, filename_unadjuster: 2.485µs, path_shortener: 1.052µs, path_absoluter: 921ns, fixer: 521ns, exclusion_paths: 461ns, exclusion_rules: 452ns, diff: 370ns, severity-rules: 120ns INFO [runner] linters took 471.54607ms with stages: goanalysis_metalinter: 470.913956ms device.go:10:6: exported: exported type Device should have comment or be unexported (revive)type Device struct { ^device_models.go:3:6: exported: exported type Model should have comment or be unexported (revive)type Model string ^device_models.go:6:2: exported: exported const ModelBasic should have comment (or a comment on this block) or be unexported (revive) ModelBasic Model = "tinySA" ^device_options.go:30:6: exported: exported type DeviceOption should have comment or be unexported (revive)type DeviceOption func(*deviceOptions) ^device_options.go:32:1: exported: exported function WithBaudRate should have comment or be unexported (revive)func WithBaudRate(baudRate int) DeviceOption {^device_options.go:38:1: exported: exported function WithLogger should have comment or be unexported (revive)func WithLogger(logger *slog.Logger) DeviceOption {^device_options.go:44:1: exported: exported function WithReadTimeout should have comment or be unexported (revive)func WithReadTimeout(timeout time.Duration) DeviceOption {^device_options.go:50:1: exported: exported function WithResponseTimeout should have comment or be unexported (revive)func WithResponseTimeout(timeout time.Duration) DeviceOption {^errors.go:5:5: exported: exported var ErrCommandResponseTimeout should have comment or be unexported (revive)var ErrCommandResponseTimeout = errors.New("command response timeout") ^examples/raw_command/main.go:1:1: package-comments: should have a package comment (revive)package main^examples/sweep/main.go:1:1: package-comments: should have a package comment (revive)package main^examples/trace_data/main.go:1:1: package-comments: should have a package comment (revive)package main^12 issues:* revive: 12INFO File cache stats: 7 entries of total size 4.2KiB INFO Memory: 7 samples, avg is 46.4MB, max is 49.0MB INFO Execution took 552.338867ms
With revive settings:
$ golangci-lint cache clean
$ golangci-lint run -vINFO golangci-lint has version 2.1.2 built with go1.24.2 from 00a561d9 on 2025-04-15T13:26:47Z INFO [config_reader] Config search paths: [./ /home/kk/projects/misc/tinysa/go-tinysa /home/kk/projects/misc/tinysa /home/kk/projects/misc /home/kk/projects /home/kk /home /] INFO [config_reader] Used config file .golangci.yml INFO maxprocs: Leaving GOMAXPROCS=16: CPU quota undefined INFO [goenv] Read go env for 3.449748ms: map[string]string{"GOCACHE":"/home/kk/.cache/go-build", "GOROOT":"/usr/local/go"} INFO [lintersdb] Active 1 linters: [revive] INFO [loader] Go packages loading at mode 8199 (name|compiled_files|files) took 80.398942ms INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 2.304223ms INFO [linters_context/goanalysis] analyzers took 2.686788ms with top 10 stages: the_only_name: 2.572005ms, typecheck: 114.783µs INFO [runner] processing took 3.244µs with stages: exclusion_paths: 531ns, max_same_issues: 380ns, exclusion_rules: 350ns, path_absoluter: 290ns, nolint_filter: 270ns, max_per_file_from_linter: 170ns, path_relativity: 160ns, path_shortener: 151ns, diff: 131ns, source_code: 130ns, max_from_linter: 110ns, filename_unadjuster: 80ns, path_prettifier: 70ns, uniq_by_line: 61ns, sort_results: 60ns, cgo: 60ns, severity-rules: 60ns, fixer: 60ns, generated_file_filter: 60ns, invalid_issue: 60ns INFO [runner] linters took 5.046507ms with stages: goanalysis_metalinter: 5.003987ms 0 issues.INFO File cache stats: 0 entries of total size 0B INFO Memory: 2 samples, avg is 38.0MB, max is 40.1MB INFO Execution took 91.608425ms
A minimal reproducible example or link to a public repository
// add your code here
Validation
Yes, I've included all information above (version, config, etc.).
Welcome
typecheck
section of the FAQ.How did you install golangci-lint?
Official binary
Description of the problem
Using this minimal
.golangci.yml
yields around 12 errors in my project (exported
,package-comments
):12 issues: * revive: 12
Now i add linter settings to ignore
package-comments
errors for revive:Running golangci-lint again, suddenly the
exported
errors are gone:Version of golangci-lint
Configuration
Go environment
Verbose output of running
Without revive settings:
With revive settings:
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: