Commited the wrong file.
This commit is contained in:
parent
18983c11df
commit
0e926c0b3f
@ -1,27 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import "fmt"
|
|
||||||
import "os"
|
|
||||||
import "os/signal"
|
|
||||||
import "syscall"
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
|
|
||||||
sigs := make(chan os.Signal, 1000000)
|
|
||||||
done := make(chan bool, 1)
|
|
||||||
|
|
||||||
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM, os.Interrupt, os.Kill)
|
|
||||||
|
|
||||||
go func() {
|
|
||||||
for i := 0; i < 3; i++ {
|
|
||||||
sig := <-sigs
|
|
||||||
fmt.Println()
|
|
||||||
fmt.Println(sig)
|
|
||||||
}
|
|
||||||
done <- true
|
|
||||||
}()
|
|
||||||
|
|
||||||
fmt.Println("awaiting signal")
|
|
||||||
<-done
|
|
||||||
fmt.Println("exiting")
|
|
||||||
}
|
|
Reference in New Issue
Block a user