]> Cypherpunks repositories - gostls13.git/commit
cmd/go: remove the -mod flag from 'go get'
authorBryan C. Mills <bcmills@google.com>
Wed, 2 Oct 2019 14:51:09 +0000 (10:51 -0400)
committerBryan C. Mills <bcmills@google.com>
Fri, 4 Oct 2019 15:47:46 +0000 (15:47 +0000)
commit6145a80608087b309251b4edf1a612739331bdee
tree21844265641515c86014f632674f797868e587d3
parentc1e46af62f2893a6beb2341ef71ffe8d3787975b
cmd/go: remove the -mod flag from 'go get'

'GOFLAGS=-mod=vendor' currently causes 'go get' to always fail unless
the '-mod' flag is explicitly overwritten. Moreover, as of CL 198319
we plan to set -mod=vendor by default if a vendor directory is
present, so all users with vendor directories will be affected — not
just those who set 'GOFLAGS' explicitly.

Similarly, an explicit '-mod=readonly' argument to 'go get' is
currently ignored as a special case, but the fact that it is ignored
(rather than rejected) can be very surprising.

Rather than adding more special cases, we should remove the '-mod'
flag from 'go get' entirely.

Fixes #30345
Fixes #32502
Updates #33848

Change-Id: Iecd3233ca3ef580ca3a66bd5e6ee8d86d4cbd8a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/198438
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
doc/go1.14.html
src/cmd/go/internal/clean/clean.go
src/cmd/go/internal/generate/generate.go
src/cmd/go/internal/get/get.go
src/cmd/go/internal/list/list.go
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/run/run.go
src/cmd/go/internal/test/testflag.go
src/cmd/go/internal/vet/vetflag.go
src/cmd/go/internal/work/build.go
src/cmd/go/testdata/script/mod_getmode_vendor.txt