Gogo
Here we gogo!
Years ago, I wrote an interesting article that I thought might be worth re-posting (and revising) here on my blog. For a while
I got into programming in golang and in the early going (pun-alert!), there were a lot of idioms that were not well understood by a noob. One of those paradigms was channels, go-routines, and signals used simultaneously. Taken separately, they are more easily understood. But when taken together, there can be some confusion. In this article, I address how to properly establish a signal-handler and a channel to terminate go-routines when the user interrupts the program with a signal such as ctrl-c
or kill(1)
.