tebata:用于golang的简单Linux信号处理程序
手旗
概述
Go的简单Linux信号处理程序
安装
go get -u github.com/syossan27/tebata
用法
package main
import (
"fmt"
"strconv"
"syscall"
"github.com/syossan27/tebata"
)
func main () {
t := tebata . New ( syscall . SIGINT , syscall . SIGTERM )
// Do function when catch signal.
t . Reserve ( sum , 1 , 2 )
t . Reserve ( hello )
t . Reserve ( os . Exit , 0 )
for {
// Do something
}
}
func sum ( firstArg