curre/lifetime.go

19 lines
231 B
Go
Raw Normal View History

2022-09-10 01:19:29 +02:00
package curre
import (
"os"
"os/signal"
"syscall"
)
type Lifetime func() int
func ConsoleLifetime() int {
signals := make(chan os.Signal, 1)
signal.Notify(signals, syscall.SIGINT, syscall.SIGTERM)
<-signals
return OK
}