1
0
Fork 0
mirror of https://github.com/pnx/pinger.git synced 2026-06-16 03:24:54 +02:00

Print signal when received

This commit is contained in:
Henrik Hautakoski 2024-05-18 17:33:55 +02:00
parent ede1205501
commit e7c49dac1c

View file

@ -34,7 +34,8 @@ func eventLoop(pinger *probing.Pinger) {
for {
select {
// Got signal. stop pinger and exit goroutine
case <-sig:
case s := <-sig:
fmt.Printf("Recived signal: %s, exiting.", s)
return
// Ticker ticks. print stats.
case <-ticker.C: