mirror of https://github.com/golang/go.git
net/http: stop ExampleServer_Shutdown from hanging on error
Running the example code when not having permissions
to bind to port 80 will cause the program to hang after
printing the error message.
Change-Id: I2433ba2629b362fc8f1731e40cab5eea72ec354f
GitHub-Last-Rev: 0bb3dc08b6
GitHub-Pull-Request: golang/go#32947
Reviewed-on: https://go-review.googlesource.com/c/go/+/185157
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
adcb2b1e7a
commit
04e2e81ecb
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue