From b3045a158a58d3e16cd1d3feaddacec56e5e24c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Flc=E3=82=9B?= Date: Mon, 29 Jan 2024 14:02:48 +0800 Subject: [PATCH 1/2] fix(signal): Fix variable overwritten in lower version of go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Flc゛ --- signal/server.go | 1 + 1 file changed, 1 insertion(+) diff --git a/signal/server.go b/signal/server.go index 5389f1a..d54e1e2 100644 --- a/signal/server.go +++ b/signal/server.go @@ -79,6 +79,7 @@ func (s *Server) Start(ctx context.Context) error { case sig := <-ch: if hs, ok := handlers[sig]; ok { for _, h := range hs { + var h = h // Fix variable overwritten in lower version of go // if Support AsyncFeature if async, ok := h.(AsyncFeature); ok && async.Async() { go s.handle(sig, h) From 26609c9d6db7f83d7497460d49385684881f304b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Flc=E3=82=9B?= Date: Mon, 29 Jan 2024 14:04:08 +0800 Subject: [PATCH 2/2] fix(signal): Fix variable overwritten in lower version of go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Flc゛ --- signal/server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/signal/server.go b/signal/server.go index d54e1e2..689296f 100644 --- a/signal/server.go +++ b/signal/server.go @@ -79,7 +79,9 @@ func (s *Server) Start(ctx context.Context) error { case sig := <-ch: if hs, ok := handlers[sig]; ok { for _, h := range hs { - var h = h // Fix variable overwritten in lower version of go + // Fix variable overwritten in lower version of go + var h = h //nolint:gofumpt + // if Support AsyncFeature if async, ok := h.(AsyncFeature); ok && async.Async() { go s.handle(sig, h)