From a57c5736c5ceb0cb81764fe4b2ed8c86deafe4ba Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 25 Oct 2023 10:20:29 +0200 Subject: [PATCH] cmd/go: remove unused (*testgoData).acquireNet test helper It's unused since CL 518775. Change-Id: Ic889f0cf1555a8503d0c2b3fb232854609d72764 Reviewed-on: https://go-review.googlesource.com/c/go/+/537597 LUCI-TryBot-Result: Go LUCI Reviewed-by: Bryan Mills Reviewed-by: David Chase --- src/cmd/go/go_test.go | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 1e28bec92d..bae83eb92f 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -391,7 +391,6 @@ type testgoData struct { tempdir string ran bool inParallel bool - hasNet bool stdout, stderr bytes.Buffer execDir string // dir for tg.run } @@ -434,9 +433,6 @@ func (tg *testgoData) parallel() { if tg.ran { tg.t.Fatal("internal testsuite error: call to parallel after run") } - if tg.hasNet { - tg.t.Fatal("internal testsuite error: call to parallel after acquireNet") - } for _, e := range tg.env { if strings.HasPrefix(e, "GOROOT=") || strings.HasPrefix(e, "GOPATH=") || strings.HasPrefix(e, "GOBIN=") { val := e[strings.Index(e, "=")+1:] @@ -449,25 +445,6 @@ func (tg *testgoData) parallel() { tg.t.Parallel() } -// acquireNet skips t if the network is unavailable, and otherwise acquires a -// netTestSem token for t to be released at the end of the test. -// -// t.Parallel must not be called after acquireNet. -func (tg *testgoData) acquireNet() { - tg.t.Helper() - if tg.hasNet { - return - } - - testenv.MustHaveExternalNetwork(tg.t) - if netTestSem != nil { - netTestSem <- struct{}{} - tg.t.Cleanup(func() { <-netTestSem }) - } - tg.setenv("TESTGONETWORK", "") - tg.hasNet = true -} - // pwd returns the current directory. func (tg *testgoData) pwd() string { tg.t.Helper() -- 2.48.1