Skip to content

Commit

Permalink
fix(examples): signal.Notify unbuffered channel
Browse files Browse the repository at this point in the history
  • Loading branch information
FedorLap2006 authored and SmoothieNoIce committed Feb 17, 2022
1 parent f011ad2 commit f9b3fff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/autocomplete/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion examples/slash_commands/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit f9b3fff

Please sign in to comment.