9 lines
266 B
Bash
9 lines
266 B
Bash
# When we run this program it will block waiting for a
|
|
# signal. By typing `ctrl-C` (which the
|
|
# terminal shows as `^C`) we can send a `SIGINT` signal,
|
|
# causing the program to print `exiting gracefully` and then exit.
|
|
$ go run signals.go
|
|
awaiting signal
|
|
^C
|
|
exiting
|