]> Cypherpunks repositories - gostls13.git/commit
cmd/go: warn about non-use of go.mod in legacy go get
authorRuss Cox <rsc@golang.org>
Thu, 19 Jul 2018 04:56:10 +0000 (00:56 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 19 Jul 2018 18:46:29 +0000 (18:46 +0000)
commitca642bb326c9eccd880f242c76f1e494d98efbc0
treeade9a0d653e61e96c9b7db20a46dc60a868dd7b1
parentceca60228205652c0791d649368dd8e550073810
cmd/go: warn about non-use of go.mod in legacy go get

It's important for a smooth transition for non-module users
not to change operation in GOPATH/src by default in Go 1.11,
even if go.mod exists in a downloaded dependency.

Even so, users create go.mod and then are confused about
why 'go get' commands seem to behave oddly, when in fact
they are getting the old 'go get'.

Try to split the difference by printing a warning in 'go get'
when run in a tree that would normally be considered a
module if only it were outside GOPATH/src.

Change-Id: I55a1cbef127f3f36de54a8d7b93e1fc64bf0a708
Reviewed-on: https://go-review.googlesource.com/124859
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/cfg/cfg.go
src/cmd/go/internal/get/get.go
src/cmd/go/internal/modload/init.go
src/cmd/go/testdata/script/mod_get_warning.txt [new file with mode: 0644]