Nicolas Martyanoff on Nostr: I do not like contexts in #Go. On the one hand they are ok at dealing with ...
I do not like contexts in #Go.
On the one hand they are ok at dealing with cancellation (manual or timeout), though you still need a wait group if you want to sync termination. I also prefer a chan most of the time so that I do not have to store the cancel function in addition of the context.
On the other hand using them to pass values in a non-typesafe way is batshit crazy. Yes, Go should add support for special (dynamically scoped) variables for that, but I won't hold my breath.
On the one hand they are ok at dealing with cancellation (manual or timeout), though you still need a wait group if you want to sync termination. I also prefer a chan most of the time so that I do not have to store the cancel function in addition of the context.
On the other hand using them to pass values in a non-typesafe way is batshit crazy. Yes, Go should add support for special (dynamically scoped) variables for that, but I won't hold my breath.