4 ms·
I presented both solutions because "it depends". Though I agree with "usually". Yes, if in doubt then block the caller. I mainly provided it as an example beca
by knorker 6y ago
I presented both solutions because "it depends". Though I agree with "usually".
Yes, if in doubt then block the caller. I mainly provided it as an example because the article had it as an explicit requirement.
You're right about errgroup. One can fit only so much in a HN comment. And I didn't want to distract by making it look like "no, you should use my favourite library instead".
But again it depends. If an error is handled by doing log.Fatal(), then there's no point in using errgroup.
I'm also not passing ctx, which much (most?) nontrivial code should pass.