aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modcmd/why.go
diff options
context:
space:
mode:
authorJay Conrod <jayconrod@google.com>2019-10-22 14:45:31 -0400
committerJay Conrod <jayconrod@google.com>2019-10-22 20:00:03 +0000
commit8ba43eaad8263f26e16846e345389146ec234364 (patch)
tree9b4e1b44e4ed4b2014db4a1fad9ee6426b4041cc /src/cmd/go/internal/modcmd/why.go
parent88186e5e232625f9c91d639e0cb90a88c6cf1172 (diff)
downloadgo-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/why.go')
-rw-r--r--src/cmd/go/internal/modcmd/why.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cmd/go/internal/modcmd/why.go b/src/cmd/go/internal/modcmd/why.go
index 03e0a039bc..93d64dcb59 100644
--- a/src/cmd/go/internal/modcmd/why.go
+++ b/src/cmd/go/internal/modcmd/why.go
@@ -8,6 +8,7 @@ import (
"cmd/go/internal/base"
"cmd/go/internal/modload"
"cmd/go/internal/module"
+ "cmd/go/internal/work"
"fmt"
"strings"
)
@@ -54,6 +55,7 @@ var (
func init() {
cmdWhy.Run = runWhy // break init cycle
+ work.AddModCommonFlags(cmdWhy)
}
func runWhy(cmd *base.Command, args []string) {