aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modcmd/vendor.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/vendor.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/vendor.go')
-rw-r--r--src/cmd/go/internal/modcmd/vendor.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cmd/go/internal/modcmd/vendor.go b/src/cmd/go/internal/modcmd/vendor.go
index bb1cecdbf5..71246b2f68 100644
--- a/src/cmd/go/internal/modcmd/vendor.go
+++ b/src/cmd/go/internal/modcmd/vendor.go
@@ -20,6 +20,7 @@ import (
"cmd/go/internal/modload"
"cmd/go/internal/module"
"cmd/go/internal/semver"
+ "cmd/go/internal/work"
)
var cmdVendor = &base.Command{
@@ -38,6 +39,7 @@ modules and packages to standard error.
func init() {
cmdVendor.Flag.BoolVar(&cfg.BuildV, "v", false, "")
+ work.AddModCommonFlags(cmdVendor)
}
func runVendor(cmd *base.Command, args []string) {