client_test.go | 7 +++---- diff --git a/client_test.go b/client_test.go index 7bc9756c063a81d653980ff4f93585bd8d2d373c..bb4fc36154fc7f7ce081fd1c5c283faf67322150 100644 --- a/client_test.go +++ b/client_test.go @@ -160,10 +160,9 @@ } } }() // Connect a UTP peer to see if the RawConn will still work. - utpPeer, err := func() *utp.Socket { - s, _ := utp.NewSocket("") - return s - }().Dial(fmt.Sprintf("localhost:%d", util.AddrPort(l.Addr()))) + s, _ := utp.NewSocket("") + defer s.Close() + utpPeer, err := s.Dial(fmt.Sprintf("localhost:%d", missinggo.AddrPort(l.Addr()))) if err != nil { t.Fatalf("error dialing utp listener: %s", err) }