Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (18 sloc) 296 Bytes
package main
import (
"os"
"os/signal"
"syscall"
)
func newStopper() chan bool {
var (
stopper = make(chan bool)
signals = make(chan os.Signal)
)
signal.Notify(signals, os.Interrupt, syscall.SIGTERM, syscall.SIGINT)
go func() {
<-signals
stopper <- true
}()
return stopper
}
You can’t perform that action at this time.