Created
April 25, 2020 14:03
-
-
Save Code-Hex/3f4366054a3c13e0e892c328715e2c89 to your computer and use it in GitHub Desktop.
shell 上でどんな signal を受け取ったか見る
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/signal" | |
| "syscall" | |
| ) | |
| func main() { | |
| sig := make(chan os.Signal, 1) | |
| signal.Notify( | |
| sig, | |
| syscall.SIGTERM, | |
| syscall.SIGHUP, | |
| syscall.SIGSTOP, | |
| syscall.SIGCONT, | |
| ) | |
| result := <-sig | |
| fmt.Println(result) | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
別セッション