]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: show -race if necessary when giving "go test -i" hint
authorShenghou Ma <minux.ma@gmail.com>
Fri, 23 Nov 2012 11:29:22 +0000 (19:29 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Fri, 23 Nov 2012 11:29:22 +0000 (19:29 +0800)
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6851100

src/cmd/go/test.go

index a55ecb95d8f4b765fe6226478de41f9971188f69..efd14609aa0c502b3f7cb1e2d735e0c78597b7f4 100644 (file)
@@ -379,7 +379,11 @@ func runTest(cmd *Command, args []string) {
                if args != "" {
                        args = " " + args
                }
-               fmt.Fprintf(os.Stderr, "installing these packages with 'go test -i%s' will speed future tests.\n\n", args)
+               extraOpts := ""
+               if buildRace {
+                       extraOpts = "-race "
+               }
+               fmt.Fprintf(os.Stderr, "installing these packages with 'go test %s-i%s' will speed future tests.\n\n", extraOpts, args)
        }
 
        b.do(root)