diff --git a/cmd/stringer/endtoend_test.go b/cmd/stringer/endtoend_test.go index ae2cc0a5a8..7e4e98fc2c 100644 --- a/cmd/stringer/endtoend_test.go +++ b/cmd/stringer/endtoend_test.go @@ -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)