I want to capture the <kbd>Ctrl+C</kbd> (SIGINT
) signal sent from the console and print out some partial run totals.
Is this possible in Golang?
Note: When I first posted the question I was confused about <kbd>Ctrl+C</kbd> being SIGTERM
instead of SIGINT
.
转载于:https://stackoverflow.com/questions/11268943/is-it-possible-to-capture-a-ctrlc-signal-and-run-a-cleanup-function-in-a-defe