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
I believe this is a Go environment setup issue rather than a golangci-lint issue.
From the pipeline link you gave, when unrolling the "Print environment" and "Prepare repo" steps, it seems that the go toolchain (which includes the go list that linters and other elements rely on to find packages) is not working in module-mode but rather in GOPATH-mode. It does not look like you are setting GO111MODULE=on and the code is checked out at the standard GOPATH location, which in Go 1.12.6 will default to GOPATH-mode despite there being a go.mod file available (in Go 1.13 this will be flipped and it should work as expected).
Furthermore you are using vendored dependencies which, in order to work with Go modules, requires you to add -mod=vendor to the GOFLAGS environment variable. Otherwise go list will prefer to resolve the dependencies located in the module cache over the ones in your vendor directory.
I might be completely off but I passed by this issue and thought I'd share the perspective. 🙂
Pipeline
I just added the package
golang.org/x/xerrors
in mygo.mod
Expected
golangci-lint to pass.
Actual
The text was updated successfully, but these errors were encountered: