Update document

Fix wrong example code in the graceful shutdown section.
This commit is contained in:
Zhiheng Lin 2022-01-26 11:26:45 +08:00 committed by GitHub
parent 580e7da6ee
commit e32c48e396
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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)
}
}()