From b28b263a91e4fd4af6900e045cd35c2ed1d6e3ff Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 17 Sep 2024 15:02:04 +0200 Subject: [PATCH] os/signal: use slices.Delete Change-Id: I212a0f4f97e1c938f56981f278464081cfd75e85 Reviewed-on: https://go-review.googlesource.com/c/go/+/613875 LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Pratt Auto-Submit: Tobias Klauser Reviewed-by: Ian Lance Taylor --- src/os/signal/signal.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/os/signal/signal.go b/src/os/signal/signal.go index 9a4cd64fb7..b9fe16baa5 100644 --- a/src/os/signal/signal.go +++ b/src/os/signal/signal.go @@ -7,6 +7,7 @@ package signal import ( "context" "os" + "slices" "sync" ) @@ -217,7 +218,7 @@ func Stop(c chan<- os.Signal) { for i, s := range handlers.stopping { if s.c == c { - handlers.stopping = append(handlers.stopping[:i], handlers.stopping[i+1:]...) + handlers.stopping = slices.Delete(handlers.stopping, i, i+1) break } }