diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 5731066fd6a..6c597ed744c 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -1700,6 +1700,8 @@ func TestMissingGOPATHEnvShowsDefault(t *testing.T) { // Test go get missing GOPATH causes go get to warn if directory doesn't exist. func TestMissingGOPATHGetWarnsIfNotExists(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + if _, err := exec.LookPath("git"); err != nil { t.Skip("skipping because git binary not found") } @@ -1727,6 +1729,8 @@ func TestMissingGOPATHGetWarnsIfNotExists(t *testing.T) { // Test go get missing GOPATH causes no warning if directory exists. func TestMissingGOPATHGetDoesntWarnIfExists(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + if _, err := exec.LookPath("git"); err != nil { t.Skip("skipping because git binary not found") } @@ -1757,6 +1761,8 @@ func TestMissingGOPATHGetDoesntWarnIfExists(t *testing.T) { // Test go get missing GOPATH fails if pointed file is not a directory. func TestMissingGOPATHGetFailsIfItsNotDirectory(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + tg := testgo(t) defer tg.cleanup() @@ -2067,9 +2073,7 @@ func TestCaseCollisions(t *testing.T) { // Issue 8181. func TestGoGetDashTIssue8181(t *testing.T) { - if testing.Short() { - t.Skip("skipping test that uses network in short mode") - } + testenv.MustHaveExternalNetwork(t) tg := testgo(t) defer tg.cleanup() @@ -2083,9 +2087,7 @@ func TestGoGetDashTIssue8181(t *testing.T) { func TestIssue11307(t *testing.T) { // go get -u was not working except in checkout directory - if testing.Short() { - t.Skip("skipping test that uses network in short mode") - } + testenv.MustHaveExternalNetwork(t) tg := testgo(t) defer tg.cleanup()