2025/12/19
About os/signal.NotifyContext:
NotifyContext returns a copy of the parent context that is marked done (its Done channel is closed) when one of the listed signals arrives, when the returned stop function is called, or when the parent context’s Done channel is closed, whichever happens first.
I’ve always used CLI frameworks like spf13/cobra, so this is the first time I’ve seen go’s built-in capability to listen for
ctrl-c!