diff --git a/src/runtime/proc_test.go b/src/runtime/proc_test.go index 67eadeac9ee..a930ea707f1 100644 --- a/src/runtime/proc_test.go +++ b/src/runtime/proc_test.go @@ -200,7 +200,7 @@ func testGoroutineParallelism2(t *testing.T, load, netpoll bool) { laddr = "127.0.0.1:0" } ln, err := net.Listen("tcp", laddr) - if err != nil { + if err == nil { defer ln.Close() // yup, defer in a loop } }