docs(readme): Modify sample code bugs (#3394)

This commit is contained in:
gobai
2022-11-17 22:34:37 +08:00
committed by GitHub
parent a0acf1df28
commit 234a1d33f7

View File

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