doc(graceful-shutdown): failure to ListenAndServe should be a reason to exit (#1287)

Signed-off-by: Romain Beuque <romain.beuque@gmail.com>
This commit is contained in:
Romain Beuque 2018-03-20 07:05:24 +01:00 committed by Bo-Yi Wu
parent 5d3f30cfc8
commit 3e3f9bca81
2 changed files with 4 additions and 4 deletions

View File

@ -1324,8 +1324,8 @@ func main() {
go func() {
// service connections
if err := srv.ListenAndServe(); err != nil {
log.Printf("listen: %s\n", err)
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
log.Fatalf("listen: %s\n", err)
}
}()

View File

@ -27,8 +27,8 @@ func main() {
go func() {
// service connections
if err := srv.ListenAndServe(); err != nil {
log.Printf("listen: %s\n", err)
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
log.Fatalf("listen: %s\n", err)
}
}()