staticcheck (no version)
Not sure why it's displaying no version. I go get'd it.
staticcheck (no version)
Compiled with Go version: go1.11.1
go version go1.12.6 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/bartek/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/bartek/gocode"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/zv/kh35w1j12wn5_4md98dl9zfr0000gn/T/go-build521415572=/tmp/go-build -gno-record-gcc-switches -fno-common"
In github.com/stellar/go:
ls -d */ \
| egrep -v '^vendor|^docs' \
| xargs -I {} -P 4 staticcheck -tests=false -checks="all,-ST1003,-SA1019,-ST1005,-ST1000,-ST1016" ./{}...
-: could not analyze dependency github.com/stellar/go/support/errors of github.com/stellar/go/address:
could not analyze dependency github.com/stellar/go/vendor/github.com/pkg/errors of github.com/stellar/go/support/errors:
could not analyze dependency fmt of github.com/stellar/go/vendor/github.com/pkg/errors:
could not analyze dependency os of fmt:
could not analyze dependency time of os:
could not load export data: no export data for "time" (compile)
Similar error in CI here.
github.com/stellar/go
It seems that the problem occurs in the first execution of staticcheck when it's started concurrently (-P 4 option in xargs). All the following executions work correctly. If the first execution of the script is without -P 4 param it also works.
Will look into it.
In the meantime, do note that staticcheck already parallelizes work, and likely does so more efficiently than you could hope to achieve by running multiple instances of it. A simple staticcheck ./... should suffice.
Upstream issue: https://github.com/golang/go/issues/29667
Upstream has fixed the issue on their end, and we backported their patches to our copy of the caching code. The next release of staticcheck coupled with the next release of Go should no longer encounter this problem.
I got a whole bunch of these kinds of messages today, with [email protected]+ and Go 1.14.2.
I run staticcheck by hack/verify-staticcheck.sh script.
I noticed maybe this caused by kubernetes using too old version of staticcheck (v0.0.1-2019.2.2).
I tried update staticcheck version to v0.0.1-2020.1.3, but I got 3 confused message about SA1019, such as follows:
vendor/k8s.io/apimachinery/pkg/api/apitesting/roundtrip/roundtrip.go:28:2: package github.com/golang/protobuf/proto is deprecated: Use the "google.golang.org/protobuf/proto" package instead. (SA1019)
I've checked https://staticcheck.io/docs/checks#SA1019, but still don't know why staticcheck reports github.com/golang/protobuf/proto is deprecated.
@dominikh Could you please take an eye on it?
I noticed maybe this caused by kubernetes using too old version of staticcheck (v0.0.1-2019.2.2).
Yes, you need to use at least 2020.1 to avoid that bug.
I've checked https://staticcheck.io/docs/checks#SA1019, but still don't know why staticcheck reports github.com/golang/protobuf/proto is deprecated.
Because it _is_ deprecated: https://github.com/golang/protobuf/blob/fa093f59480c0adaaabf88a72a0b0e48b95aec25/proto/proto.go#L12
Got it, thanks.