Hacker News new | ask | show | jobs
by nickcw 313 days ago
I love errgroup, though I always use it like this

    g, gCtx := errgroup.WithContext(ctx)
And then use gCtx in the g.Go function calls.

That would have avoided the problem.

Perhaps worth a submission to https://staticcheck.dev/ ?

1 comments

I just made very simpler linter for this: https://github.com/nikolaydubina/lint-errgroup-ctx