On Tue, Aug 7, 2018 at 7:02 PM, <nateandj...@gmail.com> wrote: > > https://play.golang.org/p/d5n9bYmya3r > > I'm new to the go language and trying to figure out how to sigint a blocking > goroutine. in the playground code I included an infinite for loop to > simulate the blocking. In my real world use the for block would be a long > running file save from an external device. I appreciate any advice or > direction that is given.
I'm not sure quite what you mean, but in general you can not send a signal to a goroutine in Go. Goroutines are not threads. If you want a goroutine to be interruptible, you must write the goroutine to check whether something is trying to interrupt it; the standard library's "context" package is often used for this purpose. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.