Add error check when closing
This commit is contained in:
parent
4e5e40f6f1
commit
38767a78d3
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue