mirror of
https://github.com/golang/go
synced 2024-11-25 07:07:57 -07:00
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:
parent
b049837d97
commit
b28b263a91
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user