os/signal: use slices.Delete

Change-Id: I212a0f4f97e1c938f56981f278464081cfd75e85
Reviewed-on: https://go-review.googlesource.com/c/go/+/613875
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Tobias Klauser 2024-09-17 15:02:04 +02:00 committed by Gopher Robot
parent b049837d97
commit b28b263a91

View File

@ -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
}
}