diff --git a/main.go b/main.go index 7bdabdb..f6249ba 100644 --- a/main.go +++ b/main.go @@ -446,7 +446,7 @@ func main() { signal.Notify(c, os.Interrupt) go func() { for range c { - defer client.Close() + client.Close() os.Exit(0) } }() @@ -613,5 +613,5 @@ func main() { // Wait for a short time as some messages are not delivered by the server // if the connection is closed immediately after sending a message. time.Sleep(defaultSleepTime * time.Millisecond) - defer client.Close() + client.Close() }