fix(examples): signal.Notify unbuffered channel
This commit is contained in:
parent
d8f15b1bc6
commit
fca422b28f
2 changed files with 3 additions and 3 deletions
|
@ -239,8 +239,8 @@ func main() {
|
|||
log.Fatalf("Cannot register commands: %v", err)
|
||||
}
|
||||
|
||||
stop := make(chan os.Signal)
|
||||
signal.Notify(stop, os.Interrupt) //nolint: staticcheck
|
||||
stop := make(chan os.Signal, 1)
|
||||
signal.Notify(stop, os.Interrupt)
|
||||
<-stop
|
||||
log.Println("Gracefully shutting down")
|
||||
|
||||
|
|
|
@ -379,7 +379,7 @@ func main() {
|
|||
|
||||
defer s.Close()
|
||||
|
||||
stop := make(chan os.Signal)
|
||||
stop := make(chan os.Signal, 1)
|
||||
signal.Notify(stop, os.Interrupt)
|
||||
<-stop
|
||||
log.Println("Gracefully shutdowning")
|
||||
|
|
Loading…
Reference in a new issue