net/http: stop ExampleServer_Shutdown from hanging on error

This commit is contained in:
Patrik Lundin 2019-07-05 00:19:51 +02:00
parent adcb2b1e7a
commit 0bb3dc08b6
1 changed files with 1 additions and 1 deletions

View File

@ -132,7 +132,7 @@ func ExampleServer_Shutdown() {
if err := srv.ListenAndServe(); err != http.ErrServerClosed {
// Error starting or closing listener:
log.Printf("HTTP server ListenAndServe: %v", err)
log.Fatalf("HTTP server ListenAndServe: %v", err)
}
<-idleConnsClosed