1
0
mirror of https://github.com/golang/go synced 2024-09-29 11:34:32 -06:00

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

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