From ce6c5b628587b4ce1419108121671f73f7019384 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 11 Dec 2024 02:50:20 -0500 Subject: [PATCH] cmd/stepd: Surpress some go vet warnings --- cmd/stepd/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/stepd/main.go b/cmd/stepd/main.go index 6e1b32d..a704974 100644 --- a/cmd/stepd/main.go +++ b/cmd/stepd/main.go @@ -201,16 +201,15 @@ func main () { } // set up the HTTP server - httpServer := http.Server { + httpServer := httpServerRoutine { Addr: config.Get("http.address"), Handler: &handler, } - httpServerRoutine := httpServerRoutine(httpServer) // set up the routine manager manager := routines.Manager { Routines: []routines.Routine { - &httpServerRoutine, + &httpServer, }, } @@ -230,9 +229,10 @@ func (this *httpServerRoutine) Run (ctx context.Context) error { server := http.Server(*this) go func () { <- ctx.Done() - shutdownCtx, _ := context.WithTimeout ( + shutdownCtx, done := context.WithTimeout ( context.Background(), 16 * time.Second) + defer done() server.Shutdown(shutdownCtx) } () err := server.ListenAndServe()