From 5a4db62873fdf278540588ab7137fe9fc9c90804 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Fri, 18 Sep 2020 10:36:05 +0200 Subject: [PATCH] Call context cancel function after shutdown. Keeps go vet from complaining. --- webserver.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webserver.go b/webserver.go index 7c26b85..ac9be94 100644 --- a/webserver.go +++ b/webserver.go @@ -473,6 +473,7 @@ func serveGroupRecordings(w http.ResponseWriter, r *http.Request, f *os.File, gr } func shutdown() { - ctx, _ := context.WithTimeout(context.Background(), 2*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) + defer cancel() server.Shutdown(ctx) }