mirror of
https://github.com/golang/go
synced 2024-11-07 13:36:19 -07:00
cmd/go: avoid panic on 'go mod' without arguments
Fixes #26738
Change-Id: Icede3f59acb5b0e388660653cefc24a195b5d43b
GitHub-Last-Rev: 9989b74c12
GitHub-Pull-Request: golang/go#26739
Reviewed-on: https://go-review.googlesource.com/127160
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
This commit is contained in:
parent
acd30e9a82
commit
27a9b1bbec
@ -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'.
|
||||
|
Loading…
Reference in New Issue
Block a user