From 97266969d8f9b0b2fd6c37121a3f0d52872efced Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Mon, 18 Jan 2016 22:42:40 -0500 Subject: [PATCH] cmd/dist: pass -tags race to go list in -race mode so that runtime/race tests are included in the race builder. Update #14011. Change-Id: I04ac6e47366fdb1fe84ba89da556c6d38f7d4a47 Reviewed-on: https://go-review.googlesource.com/18686 Run-TryBot: Minux Ma TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/dist/test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 4cd696a0a1..156b868109 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -336,7 +336,11 @@ func (t *tester) registerTests() { } else { // Use a format string to only list packages and commands that have tests. const format = "{{if (or .TestGoFiles .XTestGoFiles)}}{{.ImportPath}}{{end}}" - cmd := exec.Command("go", "list", "-f", format, "std") + cmd := exec.Command("go", "list", "-f", format) + if t.race { + cmd.Args = append(cmd.Args, "-tags", "race") + } + cmd.Args = append(cmd.Args, "std") if !t.race { cmd.Args = append(cmd.Args, "cmd") }