diff --git a/src/cmd/go/test.go b/src/cmd/go/test.go index a55ecb95d8..efd14609aa 100644 --- a/src/cmd/go/test.go +++ b/src/cmd/go/test.go @@ -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)