From 68f9dcb1f9a87f75791ab195f2a71d85c75e37c5 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Mon, 6 Feb 2023 09:06:12 -0500 Subject: [PATCH] windows/debug/svc: buffer channel passed to signal.Notify The os/signal package drops signal notifications if the channel is not ready to receive immediately. To avoid dropping signals (for example, while processing the other branch of a 'select'), the channel must be buffered. This fixes a mistake flagged by 'go vet ./...'. Change-Id: I2a20dbe2aa27ae8ec009fff5e7be47e4409fdddd Reviewed-on: https://go-review.googlesource.com/c/sys/+/465595 Auto-Submit: Bryan Mills Run-TryBot: Bryan Mills Reviewed-by: Quim Muntal Reviewed-by: David Chase TryBot-Result: Gopher Robot --- windows/svc/debug/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/svc/debug/service.go b/windows/svc/debug/service.go index 475b78e2c..684c5dcba 100644 --- a/windows/svc/debug/service.go +++ b/windows/svc/debug/service.go @@ -23,7 +23,7 @@ func Run(name string, handler svc.Handler) error { cmds := make(chan svc.ChangeRequest) changes := make(chan svc.Status) - sig := make(chan os.Signal) + sig := make(chan os.Signal, 1) signal.Notify(sig) go func() {