Skip to content

Commit a57c573

Browse files
committed
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 <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Reviewed-by: David Chase <[email protected]>
1 parent 9f84df7 commit a57c573

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

src/cmd/go/go_test.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ type testgoData struct {
391391
tempdir string
392392
ran bool
393393
inParallel bool
394-
hasNet bool
395394
stdout, stderr bytes.Buffer
396395
execDir string // dir for tg.run
397396
}
@@ -434,9 +433,6 @@ func (tg *testgoData) parallel() {
434433
if tg.ran {
435434
tg.t.Fatal("internal testsuite error: call to parallel after run")
436435
}
437-
if tg.hasNet {
438-
tg.t.Fatal("internal testsuite error: call to parallel after acquireNet")
439-
}
440436
for _, e := range tg.env {
441437
if strings.HasPrefix(e, "GOROOT=") || strings.HasPrefix(e, "GOPATH=") || strings.HasPrefix(e, "GOBIN=") {
442438
val := e[strings.Index(e, "=")+1:]
@@ -449,25 +445,6 @@ func (tg *testgoData) parallel() {
449445
tg.t.Parallel()
450446
}
451447

452-
// acquireNet skips t if the network is unavailable, and otherwise acquires a
453-
// netTestSem token for t to be released at the end of the test.
454-
//
455-
// t.Parallel must not be called after acquireNet.
456-
func (tg *testgoData) acquireNet() {
457-
tg.t.Helper()
458-
if tg.hasNet {
459-
return
460-
}
461-
462-
testenv.MustHaveExternalNetwork(tg.t)
463-
if netTestSem != nil {
464-
netTestSem <- struct{}{}
465-
tg.t.Cleanup(func() { <-netTestSem })
466-
}
467-
tg.setenv("TESTGONETWORK", "")
468-
tg.hasNet = true
469-
}
470-
471448
// pwd returns the current directory.
472449
func (tg *testgoData) pwd() string {
473450
tg.t.Helper()

0 commit comments

Comments
 (0)