diff options
author | Bryan C. Mills <bcmills@google.com> | 2019-10-02 10:51:09 -0400 |
---|---|---|
committer | Bryan C. Mills <bcmills@google.com> | 2019-10-04 15:47:46 +0000 |
commit | 6145a80608087b309251b4edf1a612739331bdee (patch) | |
tree | 21844265641515c86014f632674f797868e587d3 /src/cmd/go/internal/test/testflag.go | |
parent | c1e46af62f2893a6beb2341ef71ffe8d3787975b (diff) | |
download | go-6145a80608087b309251b4edf1a612739331bdee.tar.gz go-6145a80608087b309251b4edf1a612739331bdee.zip |
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>
Diffstat (limited to 'src/cmd/go/internal/test/testflag.go')
-rw-r--r-- | src/cmd/go/internal/test/testflag.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/internal/test/testflag.go b/src/cmd/go/internal/test/testflag.go index 138e1f9d2a..79dc5eb2a0 100644 --- a/src/cmd/go/internal/test/testflag.go +++ b/src/cmd/go/internal/test/testflag.go @@ -65,7 +65,7 @@ var testFlagDefn = []*cmdflag.Defn{ func init() { cmdflag.AddKnownFlags("test", testFlagDefn) var cmd base.Command - work.AddBuildFlags(&cmd) + work.AddBuildFlags(&cmd, work.DefaultBuildFlags) cmd.Flag.VisitAll(func(f *flag.Flag) { if f.Name == "v" { // test overrides the build -v flag |