Go Tidbit: Handling Signals, Exiting Gracefully

from blog Blog on hjr265.me, | ↗ original
Signals are standardized messages that an operating system can send your programs. Take Ctrl+C for example. When running a program from the terminal and you hit Ctrl+C, you expect the program to end immediately. How does that work, though? Ctrl+C is a shortcut for the POSIX signal SIGINT. By default, this signal causes your program to be...