telegraf/plugins/inputs/execd/examples/count.go

25 lines
267 B
Go
Raw Normal View History

2020-02-28 18:46:03 +00:00
package main
// Example using HUP signaling
import (
"fmt"
"os"
"os/signal"
"syscall"
)
func main() {
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGHUP)
counter := 0
for {
<-c
fmt.Printf("counter_go count=%d\n", counter)
counter++
}
}