Skip to content

Commit b23ff2c

Browse files
committed
cmd/go: recommend -d when -m is used
In #32038, it was decided to remove get's -m, since one former use case is removed, and the other can be done via -d, as pointed by Russ. However, a user getting this short error might not realise that they can switch to -d to skip building packages. Add a short mention to point them in the right direction. It's important to note "packages", because -m was a flag that acted on modules, while -d acts on packages. Simply replacing -m with -d might not be enough in some cases because of that distinction. Change-Id: I0947b25c4223bdad3cd0e535848527da8db8a16d Reviewed-on: https://go-review.googlesource.com/c/go/+/179361 Reviewed-by: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org>
1 parent 5d2377a commit b23ff2c

File tree

1 file changed

+1
-1
lines changed
  • src/cmd/go/internal/modget

1 file changed

+1
-1
lines changed

src/cmd/go/internal/modget/get.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ func runGet(cmd *base.Command, args []string) {
258258
fmt.Fprintf(os.Stderr, "go get: -fix flag is a no-op when using modules\n")
259259
}
260260
if *getM {
261-
base.Fatalf("go get: -m flag is no longer supported")
261+
base.Fatalf("go get: -m flag is no longer supported; consider -d to skip building packages")
262262
}
263263
modload.LoadTests = *getT
264264

0 commit comments

Comments
 (0)