Commit 27a9b1bb authored by as's avatar as Committed by Bryan C. Mills

cmd/go: avoid panic on 'go mod' without arguments

Fixes #26738

Change-Id: Icede3f59acb5b0e388660653cefc24a195b5d43b
GitHub-Last-Rev: 9989b74c12e94163c1f18859485a4ac0d74c5453
GitHub-Pull-Request: golang/go#26739
Reviewed-on: https://go-review.googlesource.com/127160Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: 's avatarBryan C. Mills <bcmills@google.com>
parent acd30e9a
......@@ -193,6 +193,8 @@ BigCmdLoop:
args = args[1:]
if len(args) == 0 {
help.PrintUsage(os.Stderr, bigCmd)
base.SetExitStatus(2)
base.Exit()
}
if args[0] == "help" {
// Accept 'go mod help' and 'go mod help foo' for 'go help mod' and 'go help mod foo'.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment