Hacker News new | ask | show | jobs
by eddythompson80 316 days ago
No? Its about errgroup ctx being automatically cancelled once the group is done (in success or err). It kinda makes sense, and its documented. I understand how it can be surprising, but if you think about it for a second, it makes sense. The context created is meant to manage the lifecycle of the errgroup. Once the group is done, the ctx is done.
1 comments

It's only about context _returned by errgroup_ being cancelled, you shouldn't be overwriting it in the way in which it was used by an article, which is really hard to spot due to variable shadowing.
> variable shadowing

There is no shadowing.

It's also harder to spot that this is a bad pattern because it's exactly what the package examples currently do.