4 ms·
You can use contexts to send a cancellation signal to goroutines: https://blog.golang.org/context https://blog.golang.org/context. This is more of an implement
by tonyhb 11y ago
You can use contexts to send a cancellation signal to goroutines: https://blog.golang.org/context https://blog.golang.org/context.
This is more of an implementation detail you make on a case-by-case language rather than a builtin to go.
- jerf 11y agoThat's not a way to "kill goroutines". That's a way to "ask goroutines to die when they get around to it." Useful, but a fundamentally different thing. Go does not have a way to kill goroutines, nor, per some of the other discussion in this thread, do I ever expect it to.