From 38767a78d3cae048b607894b0318980dcd256901 Mon Sep 17 00:00:00 2001 From: Miguel de la Cruz Date: Sun, 12 Sep 2021 18:28:49 +0200 Subject: [PATCH] Add error check when closing --- cmd/rmsn/rmsn.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/rmsn/rmsn.go b/cmd/rmsn/rmsn.go index e2c6df4..e767f40 100644 --- a/cmd/rmsn/rmsn.go +++ b/cmd/rmsn/rmsn.go @@ -34,6 +34,9 @@ func main() { s := <-c fmt.Printf("Got signal %s, exiting...\n", s) - srv.Close() + if err := srv.Close(); err != nil { + fmt.Fprintf(os.Stderr, "error closing server: %s", err) + os.Exit(1) + } <-closed }