Make shutdown docs compilable (#330)

This commit is contained in:
Kush Mansingh
2018-01-16 17:43:47 -05:00
committed by Kamil Kisiel
parent 53c1911da2
commit 0b74e3d0fe

View File

@@ -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)