tools/cmd/vet: check that cgo is enabled before testing it
Should fix the tools builders. LGTM=bradfitz R=rsc, bradfitz CC=golang-codereviews https://golang.org/cl/176530043
This commit is contained in:
parent
9393b17080
commit
0e9050009a
|
|
@ -6,6 +6,7 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"go/build"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
|
@ -45,6 +46,10 @@ func TestEndToEnd(t *testing.T) {
|
|||
t.Errorf("%s is not a Go file", name)
|
||||
continue
|
||||
}
|
||||
if name == "cgo.go" && !build.Default.CgoEnabled {
|
||||
t.Logf("cgo is no enabled for %s", name)
|
||||
continue
|
||||
}
|
||||
// Names are known to be ASCII and long enough.
|
||||
typeName := fmt.Sprintf("%c%s", name[0]+'A'-'a', name[1:len(name)-len(".go")])
|
||||
stringerCompileAndRun(t, dir, stringer, typeName, name)
|
||||
|
|
|
|||
Loading…
Reference in New Issue