I want to capture the Ctrl+C (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 Ctrl+C being SIGTERM
instead of SIGINT
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…