nettest: mark test helper functions
Fixes golang/go#30295
Change-Id: Ib98fde1f2f0d166e199238de45ca95aa34164040
Reviewed-on: https://go-review.googlesource.com/c/162925
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Mikio Hara <mikioh.public.networking@gmail.com>
diff --git a/nettest/conntest.go b/nettest/conntest.go
index dcea7f6..887033e 100644
--- a/nettest/conntest.go
+++ b/nettest/conntest.go
@@ -41,6 +41,7 @@
type connTester func(t *testing.T, c1, c2 net.Conn)
func timeoutWrapper(t *testing.T, mp MakePipe, f connTester) {
+ t.Helper()
c1, c2, stop, err := mp()
if err != nil {
t.Fatalf("unable to make pipe: %v", err)
@@ -390,6 +391,7 @@
// checkForTimeoutError checks that the error satisfies the Error interface
// and that Timeout returns true.
func checkForTimeoutError(t *testing.T, err error) {
+ t.Helper()
if nerr, ok := err.(net.Error); ok {
if !nerr.Timeout() {
t.Errorf("err.Timeout() = false, want true")
@@ -402,6 +404,7 @@
// testRoundtrip writes something into c and reads it back.
// It assumes that everything written into c is echoed back to itself.
func testRoundtrip(t *testing.T, c net.Conn) {
+ t.Helper()
if err := c.SetDeadline(neverTimeout); err != nil {
t.Errorf("roundtrip SetDeadline error: %v", err)
}
@@ -423,6 +426,7 @@
// It assumes that everything written into c is echoed back to itself.
// It assumes that 0xff is not currently on the wire or in the read buffer.
func resyncConn(t *testing.T, c net.Conn) {
+ t.Helper()
c.SetDeadline(neverTimeout)
errCh := make(chan error)
go func() {