-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Welcome
- Yes, I'm using a binary release within 2 latest releases. Only such installations are supported.
- Yes, I've searched similar issues on GitHub and didn't find any.
- Yes, I've read the
typechecksection of the FAQ. - Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.).
- I agree to follow this project's Code of Conduct
How did you install golangci-lint?
go install
Description of the problem
vscode settings
{
"go.lintTool": "golangci-lint-v2",
"go.lintFlags": [
"--fast-only",
"--path-mode=abs"
]
}The output will be like
2025-08-19 15:05:43.180 [info] Running checks...
2025-08-19 15:05:43.180 [info] Starting linting the current workspace at /Users/timhsu/app
2025-08-19 15:05:43.701 [info] /Users/timhsu/app>Finished running tool: /Users/timhsu/go/bin/golangci-lint-v2 run --fast-only --path-mode=abs --issues-exit-code=0 --output.text.print-issued-lines=false --show-stats=false --output.text.path=stdout ./...
2025-08-19 15:05:43.701 [info]
When I remove "--fast-only", the output will be like
2025-08-19 15:07:14.600 [info] Running checks...
2025-08-19 15:07:14.601 [info] Starting linting the current workspace at /Users/timhsu/app
2025-08-19 15:07:15.434 [info] /Users/timhsu/app>Finished running tool: /Users/timhsu/go/bin/golangci-lint-v2 run --path-mode=abs --issues-exit-code=0 --output.text.print-issued-lines=false --show-stats=false --output.text.path=stdout ./...
2025-08-19 15:07:15.434 [info] xxxxxxxxxxxxxxxx/yyyyyyyyyy/zzzzzzzz.go:16:2 field app is unused (unused)
2025-08-19 15:07:15.434 [info]
But golangci-lint document says
Using it in an editor without --fast-only can freeze your editor. Golangci-lint automatically discovers the .golangci.yml config for the edited file, so you don’t need to configure it in VS Code settings.
Version of golangci-lint
$ golangci-lint --version
golangci-lint has version 2.4.0 built with go1.24.6 from (unknown, modified: ?, mod sum: "h1:qz6O6vr7kVzXJqyvHjHSz5fA3D+PM8v96QU5gxZCNWM=") on (unknown)Configuration
# paste configuration file or CLI flags hereGo environment
$ go version && go env
go version go1.24.6 darwin/arm64
AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/timhsu/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/timhsu/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/yg/t8ynw6x90p7fl6f98m1pdykm0000gn/T/go-build2691484426=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/Users/timhsu/go/pkg/mod'
GONOPROXY='gitlab.com/moxa/*'
GONOSUMDB='gitlab.com/moxa/*'
GOOS='darwin'
GOPATH='/Users/timhsu/go'
GOPRIVATE='gitlab.com/moxa/*'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/timhsu/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.24.6'
GOWORK=''
PKG_CONFIG='pkg-config'Verbose output of running
$ golangci-lint cache clean
$ golangci-lint run -v
INFO golangci-lint has version 2.4.0 built with go1.24.6 from (unknown, modified: ?, mod sum: "h1:qz6O6vr7kVzXJqyvHjHSz5fA3D+PM8v96QU5gxZCNWM=") on (unknown)
INFO [config_reader] Config search paths: [./ /Users/timhsu/dev/app /Users/timhsu/dev /Users/timhsu /Users /]
INFO [config_reader] Used config file .golangci.yml
INFO [config_reader] Module name "gitlab.com/moxa/sw/nms/app"
INFO maxprocs: Leaving GOMAXPROCS=16: CPU quota undefined
INFO [goenv] Read go env for 4.5995ms: map[string]string{"GOCACHE":"/Users/timhsu/Library/Caches/go-build", "GOROOT":"/usr/local/go"}
INFO [lintersdb] Active 75 linters: [asasalint asciicheck bidichk bodyclose canonicalheader copyloopvar cyclop depguard dupl durationcheck embeddedstructfieldcheck errcheck errname errorlint exhaustive exptostd fatcontext forbidigo funcorder funlen gocheckcompilerdirectives gochecknoglobals gochecknoinits gochecksumtype gocognit goconst gocritic gocyclo godot goimports golines gomoddirectives goprintffuncname gosec govet iface ineffassign intrange loggercheck makezero mirror mnd musttag nakedret nestif nilerr nilnesserr nilnil noctx nolintlint nonamedreturns nosprintfhostport perfsprint predeclared promlinter protogetter reassign recvcheck revive rowserrcheck sloglint spancheck sqlclosecheck staticcheck testableexamples testifylint testpackage tparallel unconvert unparam unused usestdlibvars usetesting wastedassign whitespace]
INFO [loader] Go packages loading at mode 8767 (types_sizes|deps|exports_file|imports|compiled_files|files|name) took 1.392442125s
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 318.917µs
INFO [linters_context/goanalysis] analyzers took 30.855440062s with top 10 stages: buildir: 18.542154834s, exhaustive: 3.531116118s, fact_deprecated: 1.459238806s, inspect: 1.40551092s, printf: 1.163357908s, ctrlflow: 1.001561421s, findcall: 778.599864ms, fact_purity: 657.403923ms, nilness: 564.44585ms, SA5012: 499.868019ms
WARN [runner/exclusion_rules] Skipped 0 issues by rules: [Text: "exported \\S+ \\S+ should have comment( \\(or a comment on this block\\))? or be unexported", Linters: "revive"]
WARN [runner/exclusion_rules] Skipped 0 issues by rules: [Text: "package comment should be of the form \".+\"", Source: "// ?(nolint|TODO)", Linters: "revive"]
WARN [runner/exclusion_rules] Skipped 0 issues by rules: [Text: "comment on exported \\S+ \\S+ should be of the form \".+\"", Source: "// ?(nolint|TODO)", Linters: "revive, staticcheck"]
WARN [runner/exclusion_rules] Skipped 0 issues by rules: [Path: "_test\\.go", Linters: "bodyclose, dupl, errcheck, funlen, goconst, gosec, noctx, wrapcheck"]
WARN [runner/exclusion_rules] Skipped 0 issues by rules: [Source: "TODO", Linters: "godot"]
INFO [runner/exclusion_rules] Skipped 1 issues by rules: [Text: "should have a package comment", Linters: "revive"]
INFO [runner] Issues before processing: 2, after processing: 1
INFO [runner] Processors filtering stat (in/out): cgo: 2/2, invalid_issue: 2/2, generated_file_filter: 2/2, exclusion_rules: 2/1, fixer: 1/1, uniq_by_line: 1/1, path_shortener: 1/1, max_from_linter: 1/1, path_absoluter: 2/2, path_relativity: 2/2, exclusion_paths: 2/2, nolint_filter: 1/1, max_per_file_from_linter: 1/1, max_same_issues: 1/1, source_code: 1/1, path_prettifier: 1/1, filename_unadjuster: 2/2, diff: 1/1, severity-rules: 1/1, sort_results: 1/1
INFO [runner] processing took 165.124µs with stages: nolint_filter: 50.249µs, generated_file_filter: 39.042µs, exclusion_rules: 36.876µs, source_code: 15.417µs, cgo: 14.584µs, uniq_by_line: 2.582µs, path_relativity: 1.583µs, sort_results: 1.375µs, max_same_issues: 666ns, max_from_linter: 417ns, path_shortener: 417ns, path_absoluter: 376ns, invalid_issue: 332ns, fixer: 291ns, path_prettifier: 209ns, filename_unadjuster: 208ns, max_per_file_from_linter: 167ns, diff: 125ns, exclusion_paths: 125ns, severity-rules: 83ns
INFO [runner] linters took 3.697582292s with stages: goanalysis_metalinter: 3.697377s
cmd/platform.go:16:2: field app is unused (unused)
app conf.ServerConf
^
1 issues:
* unused: 1
INFO File cache stats: 1 entries of total size 698B
INFO Memory: 52 samples, avg is 865.6MB, max is 2066.0MB
INFO Execution took 5.095459375sA minimal reproducible example or link to a public repository
const (
Name = "app"
)
type Service struct {
root bootstrap.ServiceRoot
logger logging.Logger
app conf.ServerConf
}
func New(root bootstrap.ServiceRoot) bootstrap.Service {
s := &Service{
root: root,
logger: root.GetLogger(),
}
return s
}
func (s *Service) Start() error {
return nil
}
func (s *Service) Stop() error {
return nil
}
func (s *Service) Export() any {
return nil
}Validation
- Yes, I've included all information above (version, config, etc.).
Supporter
- I am a sponsor/backer through GitHub or OpenCollective
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested