]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: correctly suggest tidy instead of nonexistent fix for -fix
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>
Thu, 15 Nov 2018 23:24:51 +0000 (23:24 +0000)
committerEmmanuel Odeke <emm.odeke@gmail.com>
Thu, 15 Nov 2018 23:37:20 +0000 (23:37 +0000)
CL 129682 removed go mod fix but unfortunately
we hadn't updated the source code hence running
   go mod -fix
would suggest
   go mod fix
which is a nonexistent command.

This change fixes that to instead suggest
   go mod tidy

Change-Id: Ie0d7c90805034e9fe6df24afaa15340c44d4f426
GitHub-Last-Rev: 5ae1340954c5f6b8535f837755a7bd79ebc7109d
GitHub-Pull-Request: golang/go#28402
Reviewed-on: https://go-review.googlesource.com/c/144838
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/go/main.go

index 6a188262cce6752ccaca53044c8a9ef678036082..4f8ab7f55a9ebce3e3048e8a83c94bbb4a6a9385 100644 (file)
@@ -151,10 +151,10 @@ func main() {
                                flag = flag[:i]
                        }
                        switch flag {
-                       case "-sync":
-                               fmt.Fprintf(os.Stderr, "go: go mod -sync is now go mod tidy\n")
+                       case "-sync", "-fix":
+                               fmt.Fprintf(os.Stderr, "go: go mod %s is now go mod tidy\n", flag)
                                os.Exit(2)
-                       case "-init", "-fix", "-graph", "-vendor", "-verify":
+                       case "-init", "-graph", "-vendor", "-verify":
                                fmt.Fprintf(os.Stderr, "go: go mod %s is now go mod %s\n", flag, flag[1:])
                                os.Exit(2)
                        case "-fmt", "-json", "-module", "-require", "-droprequire", "-replace", "-dropreplace", "-exclude", "-dropexclude":