diff options
Diffstat (limited to 'src/internal/testenv/testenv.go')
-rw-r--r-- | src/internal/testenv/testenv.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/internal/testenv/testenv.go b/src/internal/testenv/testenv.go index 10384b6206..f7c4ad2682 100644 --- a/src/internal/testenv/testenv.go +++ b/src/internal/testenv/testenv.go @@ -138,6 +138,15 @@ func MustHaveExternalNetwork(t *testing.T) { } } +var haveCGO bool + +// MustHaveCGO calls t.Skip if cgo is not available. +func MustHaveCGO(t *testing.T) { + if !haveCGO { + t.Skipf("skipping test: no cgo") + } +} + // HasSymlink reports whether the current system can use os.Symlink. func HasSymlink() bool { ok, _ := hasSymlink() |