github.com/lianghucheng/zrddz@v0.0.0-20200923083010-c71f680932e2/src/golang.org/x/net/ipv6/mocktransponder_test.go (about) 1 // Copyright 2013 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package ipv6_test 6 7 import ( 8 "net" 9 "testing" 10 ) 11 12 func connector(t *testing.T, network, addr string, done chan<- bool) { 13 t.Helper() 14 defer func() { done <- true }() 15 16 c, err := net.Dial(network, addr) 17 if err != nil { 18 t.Error(err) 19 return 20 } 21 c.Close() 22 } 23 24 func acceptor(t *testing.T, ln net.Listener, done chan<- bool) { 25 t.Helper() 26 defer func() { done <- true }() 27 28 c, err := ln.Accept() 29 if err != nil { 30 t.Error(err) 31 return 32 } 33 c.Close() 34 }