3 ms·
What's the connection between `defer` and goroutines?
by oconnor663 9y ago
What's the connection between `defer` and goroutines?
- shurcooL 9y agoNot a strong connection, but both features are managed by the Go runtime.
- camus2 9y agoNone, the feature that completely depends on defer is recovering from panics. The order in which defer statements are executed is predictable, unlike goroutines.
- noncoml 9y agoYeah, none. I wrote this while still in bed. No idea what I was thinking at the time :D