Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

level=error msg="Running error: context loading failed: package github.com/sirupsen/logrus: no go files to analyze" #870

Closed
rafaelvanoni opened this issue Nov 27, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@rafaelvanoni
Copy link

I'm hitting this error when running golangci-lint v1.20.0 on github.com/projectcalico/libcalico-go

level=error msg="Running error: context loading failed: package github.com/sirupsen/logrus: no go files to analyze"

$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/go-cache"
GOENV="/home/user/.config/go/env"
GOEXE=""
GOFLAGS="-mod=vendor"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="0"
GOMOD="/go/src/github.com/projectcalico/libcalico-go/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build253984656=/tmp/go-build -gno-record-gcc-switches"

The go.mod in libcalico-go replaces logrus with our fork of that package, but the problem persists if I remove that replace statement.

@rafaelvanoni
Copy link
Author

Running go mod vendor before golangci-lint fixed this issue. But I'm not sure if golangci-lint should have considered GOFLAGS="-mod=vendor", so I'll leave this open for further comments.

@fdcds
Copy link

fdcds commented Feb 13, 2020

Probably a duplicate of #825.

@jirfag
Copy link
Member

jirfag commented May 18, 2020

Duplicate of #825

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants