docs(readme): Modify sample code bugs

This commit is contained in:
go-bai 2022-11-12 17:37:45 +08:00
parent a0acf1df28
commit 8a02d66d34

View File

@ -1854,7 +1854,7 @@ func main() {
// Initializing the server in a goroutine so that // Initializing the server in a goroutine so that
// it won't block the graceful shutdown handling below // it won't block the graceful shutdown handling below
go func() { 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) log.Printf("listen: %s\n", err)
} }
}() }()