gitee.com/quant1x/gox@v1.21.2/signal/notify.go (about)

     1  package signal
     2  
     3  import (
     4  	"os"
     5  	"os/signal"
     6  )
     7  
     8  // Notify 指定默认监控信号
     9  func Notify() chan os.Signal {
    10  	//创建监听退出chan
    11  	sigs := make(chan os.Signal)
    12  	//监听指定信号 ctrl+c kill
    13  	signal.Notify(sigs, stopSignals...)
    14  
    15  	return sigs
    16  }