diff --git a/cmd/primetime/main.go b/cmd/primetime/main.go index f2ecded..7ad3841 100644 --- a/cmd/primetime/main.go +++ b/cmd/primetime/main.go @@ -20,4 +20,5 @@ func main() { } func primetime(c net.Conn) { + defer c.Close() } diff --git a/cmd/smoketest/main.go b/cmd/smoketest/main.go index f90bcf8..717bb7b 100644 --- a/cmd/smoketest/main.go +++ b/cmd/smoketest/main.go @@ -16,6 +16,7 @@ func main() { } func smoketest(c net.Conn) { + defer c.Close() if _, err := io.Copy(c, c); err != nil { log.Fatalln(err) } diff --git a/pkg/conn/conn.go b/pkg/conn/conn.go index 3d928ba..9d266e9 100644 --- a/pkg/conn/conn.go +++ b/pkg/conn/conn.go @@ -25,7 +25,6 @@ func StartSimple(handler func(conn net.Conn)) error { return err } go handler(c) - err = c.Close() if err != nil { return err }