]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: fix nocgo builder
authorRuss Cox <rsc@golang.org>
Wed, 15 Jul 2015 05:16:47 +0000 (01:16 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 15 Jul 2015 05:23:35 +0000 (05:23 +0000)
Change-Id: I0f167d9769d9b6b9888c13fcb48e538fc87aa1b7
Reviewed-on: https://go-review.googlesource.com/12240
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/go/go_test.go

index 8af8ab6cc35c1a5f162dc4e733c7bdc78825d2f3..67f2534c7f7f5421e42f3aa0076e3986e53e2000 100644 (file)
@@ -8,6 +8,7 @@ import (
        "bytes"
        "flag"
        "fmt"
+       "go/build"
        "go/format"
        "internal/testenv"
        "io/ioutil"
@@ -2106,6 +2107,10 @@ func TestGoTestRaceInstallCgo(t *testing.T) {
                t.Skip("no race detector on %s", sys)
        }
 
+       if !build.Default.CgoEnabled {
+               t.Skip("no race detector without cgo")
+       }
+
        // golang.org/issue/10500.
        // This used to install a race-enabled cgo.
        tg := testgo(t)