diff options
Diffstat (limited to 'vendor/golang.org/x/net/ipv6/unicastsockopt_test.go')
-rw-r--r-- | vendor/golang.org/x/net/ipv6/unicastsockopt_test.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/vendor/golang.org/x/net/ipv6/unicastsockopt_test.go b/vendor/golang.org/x/net/ipv6/unicastsockopt_test.go index 1c52b3d30..e175dccf5 100644 --- a/vendor/golang.org/x/net/ipv6/unicastsockopt_test.go +++ b/vendor/golang.org/x/net/ipv6/unicastsockopt_test.go @@ -29,8 +29,15 @@ func TestConnUnicastSocketOptions(t *testing.T) { } defer ln.Close() - done := make(chan bool) - go acceptor(t, ln, done) + errc := make(chan error, 1) + go func() { + c, err := ln.Accept() + if err != nil { + errc <- err + return + } + errc <- c.Close() + }() c, err := net.Dial("tcp6", ln.Addr().String()) if err != nil { @@ -40,7 +47,9 @@ func TestConnUnicastSocketOptions(t *testing.T) { testUnicastSocketOptions(t, ipv6.NewConn(c)) - <-done + if err := <-errc; err != nil { + t.Errorf("server: %v", err) + } } var packetConnUnicastSocketOptionTests = []struct { |