Browse Source

Make shutdown docs compilable (#330)

pull/332/head
Kush Mansingh 8 years ago committed by Kamil Kisiel
parent
commit
0b74e3d0fe
  1. 3
      README.md

3
README.md

@ -436,7 +436,8 @@ func main() { @@ -436,7 +436,8 @@ func main() {
<-c
// Create a deadline to wait for.
ctx, cancel := context.WithTimeout(ctx, wait)
ctx, cancel := context.WithTimeout(context.Background(), wait)
defer cancel()
// Doesn't block if no connections, but will otherwise wait
// until the timeout deadline.
srv.Shutdown(ctx)

Loading…
Cancel
Save