Closed daixiang0 closed 5 years ago
@daixiang0 If you review the symptoms and workaround described in https://github.com/golang/go/issues/29278#issuecomment-447537558 and https://github.com/golang/go/issues/29278#issuecomment-447571410, does it look like you might be seeing #29278?
@thepudds clean mod cache does not work for me
[root@dx-test thanos]# go clean -modcache
[root@dx-test thanos]# make
>> formatting code
dgo: downloading github.com/stretchr/testify v1.2.2
go: downloading github.com/grpc-ecosystem/go-grpc-prometheus v0.0.0-20181025070259-68e3a13e4117
go: downloading github.com/grpc-ecosystem/go-grpc-middleware v1.0.0
go: downloading github.com/go-stack/stack v1.8.0
go: downloading github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515
go: downloading gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
go: downloading github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72
go: downloading github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c
go: downloading github.com/google/go-cmp v0.2.0
go: downloading github.com/hashicorp/go-uuid v1.0.0
go: downloading labix.org/v2/mgo v0.0.0-20140701140051-000000000287
go: downloading github.com/OneOfOne/xxhash v1.2.2
go: verifying github.com/grpc-ecosystem/go-grpc-middleware@v1.0.0: checksum mismatch
downloaded: h1:BWIsLfhgKhV5g/oF34aRjniBHLTZe5DNekSjbAjIS6c=
go.sum: h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c=
@thepudds any input?
@daixiang0 You mentioned in your original report that you're on Go 1.11. In Go 1.11.4, there was a change to the way we compute the hashes that go into go.sum. These are the issues that @thepudds linked to.
It's very likely that this go.sum file was written with a Go version after 1.11.4, so they have the new hashes, but your installed Go binary is still producing the old hashes. Could you try upgrading to 1.11.4 or newer?
Failing that, could you please run go mod download -json github.com/grpc-ecosystem/go-grpc-middleware@v1.0.0
and confirm the value you're seeing for Sum
? I'm seeing h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c=
with Go 1.12.1, which is the same as what's in the go.sum file.
(The change in hashes was an unforeseen consequence, and definitely something we'll avoid in the future, but we can't go back and change 1.11.4 at this point).
@jayconrod thanks very much, after upgrade it works.
@jayconrod another question, why unset GOPATH can work?
@daixiang0 Glad to hear. I'll close this.
GOPATH
doesn't need to be set explicitly whether or not module mode is enabled. It defaults to $HOME/go
(you can check the effective value with go env GOPATH
). In module mode, GOPATH
is only used to store the module cache (in $GOPATH/pkg/mod
). The contents of $GOPATH/src
are ignored.
@jayconrod Thanks you again!
With a env with GOPATH and download many pkgs:
What version of Go are you using (
go version
)?reproduce with follow cmd:
What operating system and processor architecture are you using (
go env
)?go env
Outputunset GOPATH,
make
works.