-
- Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
bugSomething isn't workingSomething isn't workingdependenciesRelates to an upstream dependencyRelates to an upstream dependency
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
The following revive
rules don't work as expected:
context-keys-type
errorf
modifies-value-receiver
range-val-address
string-of-int
time-equal
time-naming
unexported-return
unhandled-error
var-declaration
The problem seems to only happen with the integration of revive
inside golangci-lint
(I was not able to reproduce the behavior with revive
as CLI).
The problem is hidden because an error is ignored inside revive
, so it is not possible to see the problem.
The problem cannot be easily detected by tests because it requires using 2 different GOROOT
+ GOPATH
+ Go versions, and using -trimpath
during compilation (the problem also happens without -trimpath
but the cases are more complex to obtain).
For now, I have no idea how to fix that, but I'm working on it.
Related to golangci/golangci-lint-action#1197
Version of golangci-lint
$ golangci-lint --version golangci-lint has version 1.64.8 built with go1.24.1 from 8b37f141 on 2025-03-17T20:41:53Z
Configuration
linters: disable-all: true enable: - revive linters-settings: revive: enable-all-rules: false rules: - name: unhandled-error - name: context-keys-type - name: errorf - name: modifies-value-receiver - name: range-val-address - name: string-of-int - name: time-equal - name: time-naming - name: unexported-return - name: unhandled-error - name: var-declaration
Go environment
$ go version && go env go version go1.23.7 linux/amd64 GO111MODULE='on' GOARCH='amd64' GOBIN='' GOCACHE='/home/ldez/.cache/go-build' GOENV='/home/ldez/.config/go/env' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='amd64' GOHOSTOS='linux' GOINSECURE='' GOMODCACHE='/home/ldez/sources/go/pkg/mod' GONOPROXY='' GONOSUMDB='' GOOS='linux' GOPATH='/home/ldez/sources/go' GOPRIVATE='' GOPROXY='https://proxy.golang.org,direct' GOROOT='/home/ldez/.gvm/gos/go1.23.7' GOSUMDB='sum.golang.org' GOTMPDIR='' GOTOOLCHAIN='auto' GOTOOLDIR='/home/ldez/.gvm/gos/go1.23.7/pkg/tool/linux_amd64' GOVCS='' GOVERSION='go1.23.7' GODEBUG='' GOTELEMETRY='on' GOTELEMETRYDIR='/home/ldez/.config/go/telemetry' GCCGO='gccgo' GOAMD64='v1' AR='ar' CC='gcc' CXX='g++' CGO_ENABLED='1' GOMOD='/home/ldez/sources/experimental/fiber/go.mod' GOWORK='' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' PKG_CONFIG='pkg-config' GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3489667529=/tmp/go-build -gno-record-gcc-switches
Verbose output of running
$ golangci-lint cache clean $ golangci-lint run -v
A minimal reproducible example or link to a public repository
package sandbox func Bar() { foo() } func foo() error { return nil }
Validation
- Yes, I've included all information above (version, config, etc.).
Supporter
- I am a sponsor/backer through GitHub or OpenCollective
ccoVeille
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdependenciesRelates to an upstream dependencyRelates to an upstream dependency