diff --git a/src/pkg/net/tcp_test.go b/src/pkg/net/tcp_test.go index 15f46a1361..1af9616a01 100644 --- a/src/pkg/net/tcp_test.go +++ b/src/pkg/net/tcp_test.go @@ -456,12 +456,6 @@ func TestTCPReadWriteMallocs(t *testing.T) { if testing.Short() { t.Skip("skipping malloc count in short mode") } - maxMallocs := 10000 - switch runtime.GOOS { - // Add other OSes if you know how many mallocs they do. - case "windows": - maxMallocs = 0 - } ln, err := Listen("tcp", "127.0.0.1:0") if err != nil { t.Fatalf("Listen failed: %v", err) @@ -493,8 +487,8 @@ func TestTCPReadWriteMallocs(t *testing.T) { t.Fatalf("Read failed: %v", err) } }) - if int(mallocs) > maxMallocs { - t.Fatalf("Got %v allocs, want %v", mallocs, maxMallocs) + if mallocs > 0 { + t.Fatalf("Got %v allocs, want 0", mallocs) } }