From e32c48e396a1745890fa3148bb229000161e687c Mon Sep 17 00:00:00 2001 From: Zhiheng Lin Date: Wed, 26 Jan 2022 11:26:45 +0800 Subject: [PATCH] Update document Fix wrong example code in the graceful shutdown section. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b75df63f..51ffc5e9 100644 --- a/README.md +++ b/README.md @@ -1818,7 +1818,7 @@ func main() { // Initializing the server in a goroutine so that // it won't block the graceful shutdown handling below go func() { - if err := srv.ListenAndServe(); err != nil && errors.Is(err, http.ErrServerClosed) { + if err := srv.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) { log.Printf("listen: %s\n", err) } }()