nettest: remove Go 1.6 compatibility code
Go 1.6 has been unsupported for some time now, so let's clean up
this unnecessary scaffolding code.
Change-Id: I9c4f05b2dd142226c65906f7a2d5327369d81ee5
Reviewed-on: https://go-review.googlesource.com/c/net/+/168800
Run-TryBot: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Mikio Hara <mikioh.public.networking@gmail.com>
diff --git a/nettest/conntest.go b/nettest/conntest.go
index 887033e..ff9b20b 100644
--- a/nettest/conntest.go
+++ b/nettest/conntest.go
@@ -35,7 +35,17 @@
// run multiple times. For maximal effectiveness, run the tests under the
// race detector.
func TestConn(t *testing.T, mp MakePipe) {
- testConn(t, mp)
+ t.Run("BasicIO", func(t *testing.T) { timeoutWrapper(t, mp, testBasicIO) })
+ t.Run("PingPong", func(t *testing.T) { timeoutWrapper(t, mp, testPingPong) })
+ t.Run("RacyRead", func(t *testing.T) { timeoutWrapper(t, mp, testRacyRead) })
+ t.Run("RacyWrite", func(t *testing.T) { timeoutWrapper(t, mp, testRacyWrite) })
+ t.Run("ReadTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testReadTimeout) })
+ t.Run("WriteTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testWriteTimeout) })
+ t.Run("PastTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testPastTimeout) })
+ t.Run("PresentTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testPresentTimeout) })
+ t.Run("FutureTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testFutureTimeout) })
+ t.Run("CloseTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testCloseTimeout) })
+ t.Run("ConcurrentMethods", func(t *testing.T) { timeoutWrapper(t, mp, testConcurrentMethods) })
}
type connTester func(t *testing.T, c1, c2 net.Conn)
diff --git a/nettest/conntest_go16.go b/nettest/conntest_go16.go
deleted file mode 100644
index 4cbf48e..0000000
--- a/nettest/conntest_go16.go
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.7
-
-package nettest
-
-import "testing"
-
-func testConn(t *testing.T, mp MakePipe) {
- // Avoid using subtests on Go 1.6 and below.
- timeoutWrapper(t, mp, testBasicIO)
- timeoutWrapper(t, mp, testPingPong)
- timeoutWrapper(t, mp, testRacyRead)
- timeoutWrapper(t, mp, testRacyWrite)
- timeoutWrapper(t, mp, testReadTimeout)
- timeoutWrapper(t, mp, testWriteTimeout)
- timeoutWrapper(t, mp, testPastTimeout)
- timeoutWrapper(t, mp, testPresentTimeout)
- timeoutWrapper(t, mp, testFutureTimeout)
- timeoutWrapper(t, mp, testCloseTimeout)
- timeoutWrapper(t, mp, testConcurrentMethods)
-}
diff --git a/nettest/conntest_go17.go b/nettest/conntest_go17.go
deleted file mode 100644
index fa039f0..0000000
--- a/nettest/conntest_go17.go
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build go1.7
-
-package nettest
-
-import "testing"
-
-func testConn(t *testing.T, mp MakePipe) {
- // Use subtests on Go 1.7 and above since it is better organized.
- t.Run("BasicIO", func(t *testing.T) { timeoutWrapper(t, mp, testBasicIO) })
- t.Run("PingPong", func(t *testing.T) { timeoutWrapper(t, mp, testPingPong) })
- t.Run("RacyRead", func(t *testing.T) { timeoutWrapper(t, mp, testRacyRead) })
- t.Run("RacyWrite", func(t *testing.T) { timeoutWrapper(t, mp, testRacyWrite) })
- t.Run("ReadTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testReadTimeout) })
- t.Run("WriteTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testWriteTimeout) })
- t.Run("PastTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testPastTimeout) })
- t.Run("PresentTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testPresentTimeout) })
- t.Run("FutureTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testFutureTimeout) })
- t.Run("CloseTimeout", func(t *testing.T) { timeoutWrapper(t, mp, testCloseTimeout) })
- t.Run("ConcurrentMethods", func(t *testing.T) { timeoutWrapper(t, mp, testConcurrentMethods) })
-}