]> Cypherpunks repositories - gostls13.git/commit
cmd/go: diagnose go.mod and vendor out of sync in std and cmd
authorRuss Cox <rsc@golang.org>
Tue, 30 Apr 2019 20:04:50 +0000 (16:04 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 9 May 2019 00:01:25 +0000 (00:01 +0000)
commit856b57e0d42f104e762b5df7701133c0aef4dc5f
treeae5b89e9db1d484a454a38a5baf086c7e0d8734b
parent41df5aeb7f02a47ff7ccf5002140b70b04a4fd46
cmd/go: diagnose go.mod and vendor out of sync in std and cmd

The most common failure mode of the current std/cmd setup is
going to be people running "go get m@latest" and then not running
"go mod vendor" and being confused about getting the old m.
Diagnose and report what to do.

Also, having done the check, when in the standard library,
switch the go command to -mod=vendor mode.
This avoids some network accesses I saw when running
'go clean -modcache' before doing some work in cmd.

Change-Id: I0ba4a66637b67225a9b97a1c89f26f9015b41673
Reviewed-on: https://go-review.googlesource.com/c/go/+/174528
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/modload/init.go
src/go.mod
src/go.sum
src/vendor/modules.txt