Description
Thank you for creating the issue!
- Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
- Yes, I've searched similar issues on GitHub and didn't find any.
- Yes, I've included all information below (version, config, etc).
Please include the following information:
Version of golangci-lint
$ golangci-lint --version
golangci-lint has version 1.21.0 built from 645e794 on 2019-10-15T18:16:56Z
Config file
$ cat .golangci.yml
run:
timeout: "10m"
linters:
disable-all: true
enable:
- "bodyclose"
- "deadcode"
- "depguard"
- "errcheck"
- "gocritic"
- "gocyclo"
- "gofmt"
- "goimports"
- "golint"
- "govet"
- "ineffassign"
- "megacheck"
- "misspell"
- "nakedret"
- "structcheck"
- "unconvert"
- "unparam"
- "varcheck"
linters-settings:
depguard:
list-type: blacklist
include-go-root: true
packages:
- errors
- reflect
- unsafe
- github.com/pkg/errors
gocyclo:
min-complexity: 10
govet:
enable-all: true
settings:
printf:
funcs:
- "(github.com/XXX/golang-libraries/errors).Newf"
- "(github.com/XXX/golang-libraries/errors).WithMessagef"
- "(github.com/XXX/golang-libraries/errors).Wrapf"
issues:
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0
Go environment
$ go version && go env
go version go1.13.5 linux/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/pierre/.cache/go-build"
GOENV="/home/pierre/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/pierre/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/pierre/.gimme/versions/go1.13.5.src"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/pierre/.gimme/versions/go1.13.5.src/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/pierre/gosrc/github.com/XXX/golang-libraries/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build476918749=/tmp/go-build -gno-record-gcc-switches"
Verbose output of running
$ golangci-lint run -v
none, sorry
Sometimes, when I run golangci-lint I get this strange error.
WARN [runner] Can't run linter goanalysis_metalinter: findcall: analysis skipped: errors in package: [/home/travis/gopath/src/github.com/XXX/golang-libraries/mgotest/mgotest.go:66:28: cannot use context.Background() (value of type context.Context) as context.Context value in argument to mgo.ParseURL: wrong type for method Deadline /home/travis/gopath/src/github.com/XXX/golang-libraries/mgotest/mgotest.go:72:32: cannot use context.Background() (value of type context.Context) as context.Context value in argument to mgo.DialWithInfo: wrong type for method Deadline /home/travis/gopath/src/github.com/XXX/golang-libraries/mgotest/mgotest.go:58:23: cannot use context.Background() (value of type context.Context) as context.Context value in argument to db.DropDatabase: wrong type for method Deadline]
But there is actually nothing wrong in my code.
It compiles perfectly fine.
If I run golangci-lint again, it works fine.
If I flush the golangci-lint cache and run it again, it works fine.
I can't reproduce the issue, it happens randomly (including on my CI server), but I saw it many times in the past few months.
The problem is worse, when it happens:
- It displays a warning message (but no one will read it on the CI, see below)
- No linter is actually executed, so it will not detect any error, if any
- It exits with the status 0
It's a huge issue on my CI server, because a build may appear as positive, but it actually didn't run anything.
Is it possible to fail (return a non 0 status) for this issue ?
At least it will notify me that I must run the build again.
Is it possible to fix this issue ?
I don't have any verbose output, because it happens randomly, and I can't reproduce it reliably.
If it's really needed, I could enable the verbose output on all my projects/build, but I can't guarantee when I will be able to give you new logs.