From 8ba8c2b833f54e4f3c075498d7dd18aa89bf4fdc Mon Sep 17 00:00:00 2001 From: V Date: Sat, 14 Aug 2021 17:06:13 +0200 Subject: that doesn't need to be waited on thanks for the catch, edef --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 3da87b6..67ce48c 100644 --- a/main.go +++ b/main.go @@ -72,8 +72,8 @@ func main() { group, ctx := errgroup.WithContext(ctx) srv.BaseContext = func(net.Listener) context.Context { return ctx } - group.Go(func() error { - // Catch SIGTERM so we can shutdown gracefully. + // Catch SIGTERM so we can shutdown gracefully. + go func() error { sig := make(chan os.Signal, 1) signal.Notify(sig, syscall.SIGTERM, syscall.SIGINT) @@ -86,7 +86,7 @@ func main() { } return nil - }) + }() for _, ln := range lns { // Loop variables are unsafe to close over with goroutines, -- cgit 1.4.1