Files
gocryptotrader/signaler/signaler.go
Adrian Gallagher f5faca2eb2 linter: Enable gofumpt and run against codebase (#1848)
* linter: Enable gofumpt and run against codebase

* Address shazbert's nits

* gofumpt: Fix issues after rebase
2025-03-18 10:23:16 +11:00

26 lines
359 B
Go

package signaler
import (
"os"
"os/signal"
"syscall"
)
var s = make(chan os.Signal, 1)
func init() {
sigs := []os.Signal{
os.Interrupt,
os.Kill,
syscall.SIGTERM,
syscall.SIGABRT,
}
signal.Notify(s, sigs...)
}
// WaitForInterrupt waits until a os.Signal is
// received and returns the result
func WaitForInterrupt() os.Signal {
return <-s
}