-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
bugSomething isn't workingSomething isn't working
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
typecheck
section 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?
Official binary
Description of the problem
When running golangci-lint with gocritic with enable-all
enabled and a test function shadowing fmt, I'm getting no output to do with the issue. I then tried the gocritic tool manually gocritic check -enable importShadow ./...
and it picked up those issues without any problems.
Version of golangci-lint
$ golangci-lint --version
# golangci-lint has version 2.0.2 built with go1.24.1 from 2b224c2c on 2025-03-25T21:36:18Z
Configuration
version: "2"
run:
issues-exit-code: 1
tests: true
linters:
default: none
enable:
# defaults
- errcheck
- govet
- ineffassign
- staticcheck
# - unused
# disabled by default linters
# - asasalint
- asciicheck
- bidichk
- bodyclose
# - canonicalheader
- containedctx
# - contextcheck
- copyloopvar
# - cyclop
- decorder
- depguard
- dogsled
# - dupl
- dupword
- durationcheck
# - err113
- errchkjson
- errname
# - errorlint
# - exhaustive
# - exhaustruct
# - exptostd
- fatcontext
# - forbidigo
- forcetypeassert
# - funlen
# - ginkgolinter
- gocheckcompilerdirectives
# - gochecknoglobals
# - gochecknoinits
- gochecksumtype
# - gocognit
- goconst
- gocritic
# - gocyclo
# - godot
# - godox
# - goheader
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
# - gosmopolitan
- grouper
- iface
# - importas
# - inamedparam
# - interfacebloat
- intrange
# - ireturn
# - lll
# - loggercheck
# - maintidx
- makezero
- mirror
- misspell
# - mnd
# - musttag
# - nakedret
# - nestif
- nilerr
- nilnesserr
# - nilnil
# - nlreturn
- noctx
- nolintlint
# - nonamedreturns
- nosprintfhostport
# - paralleltest
- perfsprint
- prealloc
- predeclared
# - promlinter
# - protogetter
- reassign
# - recvcheck
- revive
- rowserrcheck
# - sloglint
# - spancheck
- sqlclosecheck
- tagalign
# - tagliatelle
- testableexamples
- testifylint
# - testpackage
- thelper
- tparallel
- unconvert
- unparam
- usestdlibvars
- usetesting
# - varnamelen
- wastedassign
- whitespace
# - wrapcheck
# - wsl
# - zerologlint
settings:
depguard:
rules:
prevent_json_package_use:
list-mode: lax
files:
- $all
allow:
- github.com/thrasher-corp/gocryptotrader/encoding/json
deny:
- pkg: encoding/json
desc: Please use the custom JSON package github.com/thrasher-corp/gocryptotrader/encoding/json instead of encoding/json to allow sonic/json switching.
goconst:
min-occurrences: 6
gocritic:
enable-all: true
disabled-checks:
- evalOrder
govet:
enable:
- shadow
- nilness
- unusedwrite
staticcheck:
checks:
- all
- '-ST1000' # Disable at least one file in a package should have a package comment check
- '-QF1005' # Disable expand call to math.Pow check
- '-QF1008' # Disable embedded field from selector check
testifylint:
enable-all: true
disable:
- require-error
- float-compare
# We deliberately use Equal over Len to avoid spamming the contents of large Slices
- len
exclusions:
generated: lax
presets:
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- gosec
text: Expect WriteFile permissions to be 0600 or less
- linters:
- govet
text: 'shadow: declaration of "err" shadows declaration at'
- linters:
- revive
text: 'should have a package comment'
paths:
- vendor
- web/
- testdata
- database/models/
- third_party$
- builtin$
- examples$
issues:
max-issues-per-linter: 0
max-same-issues: 0
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
settings:
gofumpt:
extra-rules: true
exclusions:
generated: lax
paths:
- vendor
- web/
- testdata
- database/models/
- third_party$
- builtin$
- examples$
Go environment
$ go version && go env
go version go1.24.1 windows/amd64
set AR=ar
set CC=gcc
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_ENABLED=1
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set CXX=g++
set GCCGO=gccgo
set GO111MODULE=
set GOAMD64=v1
set GOARCH=amd64
set GOAUTH=netrc
set GOBIN=
set GOCACHE=C:\Users\AdrianGallagher\AppData\Local\go-build
set GOCACHEPROG=
set GODEBUG=
set GOENV=C:\Users\AdrianGallagher\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFIPS140=off
set GOFLAGS=
set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\ADRIAN~1\AppData\Local\Temp\go-build2838124255=/tmp/go-build -gno-record-gcc-switches
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMOD=C:\Users\AdrianGallagher\go\src\github.com\thrasher-corp\gocryptotrader\go.mod
set GOMODCACHE=C:\Users\AdrianGallagher\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\AdrianGallagher\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTELEMETRY=local
set GOTELEMETRYDIR=C:\Users\AdrianGallagher\AppData\Roaming\go\telemetry
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.24.1
set GOWORK=
set PKG_CONFIG=pkg-config
Verbose output of running
$ golangci-lint cache clean
$ golangci-lint run -v
$ golangci-lint run -v
level=info msg="golangci-lint has version 2.0.2 built with go1.24.1 from 2b224c2c on 2025-03-25T21:36:18Z"
level=info msg="[config_reader] Config search paths: [./ C:\\Users\\AdrianGallagher\\go\\src\\github.com\\thrasher-corp\\gocryptotrader C:\\Users\\AdrianGallagher\\go\\src\\github.com\\thrasher-corp C:\\Users\\AdrianGallagher\\go\\src\\github.com C:\\Users\\AdrianGallagher\\go\\src C:\\Users\\AdrianGallagher\\go C:\\Users\\AdrianGallagher C:\\Users C:\\]"
level=info msg="[config_reader] Used config file .golangci.yml"
level=info msg="maxprocs: Leaving GOMAXPROCS=64: CPU quota undefined"
level=info msg="[goenv] Read go env for 107.1281ms: map[string]string{\"GOCACHE\":\"C:\\\\Users\\\\AdrianGallagher\\\\AppData\\\\Local\\\\go-build\", \"GOROOT\":\"C:\\\\Program Files\\\\Go\"}"
level=info msg="[lintersdb] Active 58 linters: [asciicheck bidichk bodyclose containedctx copyloopvar decorder depguard dogsled dupword durationcheck errcheck errchkjson errname fatcontext forcetypeassert gci gocheckcompilerdirectives gochecksumtype goconst gocritic gofmt gofumpt goimports gomoddirectives gomodguard goprintffuncname gosec govet grouper iface ineffassign intrange makezero mirror misspell nilerr nilnesserr noctx nolintlint nosprintfhostport perfsprint prealloc predeclared reassign revive rowserrcheck sqlclosecheck staticcheck tagalign testableexamples testifylint thelper tparallel unconvert unparam usestdlibvars wastedassign whitespace]"
level=info msg="[loader] Go packages loading at mode 8767 (compiled_files|deps|exports_file|files|types_sizes|imports|name) took 13.3772698s"
level=info msg="[runner/filename_unadjuster] Pre-built 0 adjustments in 110.8382ms"
level=info msg="[linters_context/goanalysis] analyzers took 8m13.1413344s with top 10 stages: gocritic: 5m57.6610603s, goimports: 1m23.7309636s, buildir: 12.9818815s, wastedassign: 5.6575367s, the_only_name: 4.16968s, unparam: 3.2314804s, gosec: 2.8211836s, gofumpt: 2.0454259s, buildssa: 1.1816759s, S1038: 1.1538696s"
level=info msg="[runner/exclusion_paths] Skipped 0 issues by pattern \"third_party$\""
level=info msg="[runner/exclusion_paths] Skipped 0 issues by pattern \"builtin$\""
level=info msg="[runner/exclusion_paths] Skipped 0 issues by pattern \"examples$\""
level=info msg="[runner/exclusion_paths] Skipped 0 issues by pattern \"vendor\""
level=info msg="[runner/exclusion_paths] Skipped 0 issues by pattern \"web\\\\\\\\\""
level=info msg="[runner/exclusion_paths] Skipped 0 issues by pattern \"testdata\""
level=info msg="[runner/exclusion_paths] Skipped 1534 issues by pattern \"database\\\\\\\\models\\\\\\\\\""
level=info msg="[runner/exclusion_rules] Skipped 2 issues by rules: [Text: \"Expect WriteFile permissions to be 0600 or less\", Linters: \"gosec\"]"
level=info msg="[runner/exclusion_rules] Skipped 28 issues by rules: [Text: \"shadow: declaration of \\\"err\\\" shadows declaration at\", Linters: \"govet\"]"
level=info msg="[runner/exclusion_rules] Skipped 0 issues by rules: [Path: \"web\\\\\\\\\", Linters: \"gci, gofmt, gofumpt, goimports\"]"
level=info msg="[runner/exclusion_rules] Skipped 0 issues by rules: [Path: \"third_party$\", Linters: \"gci, gofmt, gofumpt, goimports\"]"
level=info msg="[runner/exclusion_rules] Skipped 0 issues by rules: [Path: \"builtin$\", Linters: \"gci, gofmt, gofumpt, goimports\"]"
level=info msg="[runner/exclusion_rules] Skipped 162 issues by rules: [Text: \"should have a package comment\", Linters: \"revive\"]"
level=info msg="[runner/exclusion_rules] Skipped 0 issues by rules: [Path: \"vendor\", Linters: \"gci, gofmt, gofumpt, goimports\"]"
level=info msg="[runner/exclusion_rules] Skipped 0 issues by rules: [Path: \"testdata\", Linters: \"gci, gofmt, gofumpt, goimports\"]"
level=info msg="[runner/exclusion_rules] Skipped 0 issues by rules: [Path: \"database\\\\\\\\models\\\\\\\\\", Linters: \"gci, gofmt, gofumpt, goimports\"]"
level=info msg="[runner/exclusion_rules] Skipped 0 issues by rules: [Path: \"examples$\", Linters: \"gci, gofmt, gofumpt, goimports\"]"
level=warning msg="[runner/nolint_filter] Found unknown linters in //nolint directives: ifshort"
level=info msg="[runner] Issues before processing: 4228, after processing: 0"
level=info msg="[runner] Processors filtering stat (in/out): path_absoluter: 4228/4228, invalid_issue: 4228/4228, cgo: 4228/4228, filename_unadjuster: 4228/4228, path_relativity: 4228/4228, generated_file_filter: 2694/762, exclusion_rules: 762/465, exclusion_paths: 4228/2694, nolint_filter: 465/0"
level=info msg="[runner] processing took 224.0972ms with stages: nolint_filter: 184.2359ms, generated_file_filter: 28.7338ms, path_relativity: 4.7657ms, exclusion_rules: 3.6786ms, exclusion_paths: 1.596ms, invalid_issue: 544.9µs, cgo: 542.3µs, source_code: 0s, fixer: 0s, path_prettifier: 0s, sort_results: 0s, severity-rules: 0s, path_absoluter: 0s, diff: 0s, max_per_file_from_linter: 0s, path_shortener: 0s, max_from_linter: 0s, filename_unadjuster: 0s, max_same_issues: 0s, uniq_by_line: 0s"
level=info msg="[runner] linters took 16.3985956s with stages: goanalysis_metalinter: 16.1724567s"
0 issues.
level=info msg="File cache stats: 0 entries of total size 0B"
level=info msg="Memory: 303 samples, avg is 1551.1MB, max is 4082.2MB"
level=info msg="Execution took 30.1564123s"
A minimal reproducible example or link to a public repository
func simpleTest() {
fmt := "meep"
log.Println(fmt)
}
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
bugSomething isn't workingSomething isn't working