diff --git a/examples/server.go b/examples/server.go index 2f6ac88..29d5bf1 100644 --- a/examples/server.go +++ b/examples/server.go @@ -48,7 +48,8 @@ func main() { case <-c: // Shutdown the server log.Println("Shutting down...") - ctx, _ := context.WithTimeout(context.Background(), 30*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() err := server.Shutdown(ctx) if err != nil { log.Fatal(err)