From 5a901eada34e6164b77aa099701422374fb45f15 Mon Sep 17 00:00:00 2001 From: Kioubit Date: Mon, 27 Dec 2021 06:37:08 -0500 Subject: [PATCH] Fix unbuffered os.Signal channel error --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index de9ccef..6ea0347 100644 --- a/main.go +++ b/main.go @@ -11,7 +11,7 @@ import ( // WaitForSignal Waits (blocking) for the program to be interrupted by the OS func WaitForSignal() { - var sigCh = make(chan os.Signal) + var sigCh = make(chan os.Signal, 1) signal.Notify(sigCh, os.Interrupt, syscall.SIGTERM) <-sigCh close(sigCh)