diff options
author | Jay Conrod <jayconrod@google.com> | 2019-10-22 14:45:31 -0400 |
---|---|---|
committer | Jay Conrod <jayconrod@google.com> | 2019-10-22 20:00:03 +0000 |
commit | 8ba43eaad8263f26e16846e345389146ec234364 (patch) | |
tree | 9b4e1b44e4ed4b2014db4a1fad9ee6426b4041cc /src/cmd/go/internal/modcmd/graph.go | |
parent | 88186e5e232625f9c91d639e0cb90a88c6cf1172 (diff) | |
download | go-8ba43eaad8263f26e16846e345389146ec234364.tar.gz go-8ba43eaad8263f26e16846e345389146ec234364.zip |
cmd/go: support -modcacherw in 'go mod' subcommands
The -modcacherw flag is now registered in work.AddModCommonFlags,
which is called from work.AddBuildFlags, where it was registered
before. 'go mod' subcommands register the flag by calling
work.AddModCommonFlags directly.
Also, build commands now exit with an error if -modcacherw is set
explicitly (not in GOFLAGS) in GOPATH mode.
Updates #31481
Change-Id: I461e59a51ed31b006fff4d5c57c2a866be0bbf38
Reviewed-on: https://go-review.googlesource.com/c/go/+/202563
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/modcmd/graph.go')
-rw-r--r-- | src/cmd/go/internal/modcmd/graph.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/go/internal/modcmd/graph.go b/src/cmd/go/internal/modcmd/graph.go index 8fcb84f280..5dbbf332fb 100644 --- a/src/cmd/go/internal/modcmd/graph.go +++ b/src/cmd/go/internal/modcmd/graph.go @@ -16,6 +16,7 @@ import ( "cmd/go/internal/modload" "cmd/go/internal/module" "cmd/go/internal/par" + "cmd/go/internal/work" ) var cmdGraph = &base.Command{ @@ -30,6 +31,10 @@ path@version, except for the main module, which has no @version suffix. Run: runGraph, } +func init() { + work.AddModCommonFlags(cmdGraph) +} + func runGraph(cmd *base.Command, args []string) { if len(args) > 0 { base.Fatalf("go mod graph: graph takes no arguments") |