From 6937eb7a80382ff6e05c69c8db46fff344e5ea8e Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 3 May 2023 04:57:04 +0200 Subject: [PATCH] go: explicitly close chan --- run.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/run.go b/run.go index f956ede..f0286a2 100644 --- a/run.go +++ b/run.go @@ -139,8 +139,6 @@ func run() error { // channel used to check whether the app had troubles starting up. started := make(chan error, 1) - defer close(started) - go func(ok chan error) { p := setting.Port() h := setting.Host() @@ -155,6 +153,7 @@ func run() error { defer func() { cancel() started <- err + close(started) }() log.Info("shutting down the server")