What is Nostr?
Nicolas Martyanoff /
npub1dkg…54dt
2024-10-31 12:07:33

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.
Author Public Key
npub1dkg70vzk4vvfsc5cup9gkfu2tcrs5unysl7npfvegf78nkuswr5skh54dt