Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: expose MultiError #8

Merged
merged 1 commit into from
Oct 3, 2024
Merged

Proposal: expose MultiError #8

merged 1 commit into from
Oct 3, 2024

Conversation

ahmetb
Copy link
Contributor

@ahmetb ahmetb commented Oct 3, 2024

One of the great things about semgroup over x/sync/errgroup is that it actually waits all tasks to complete and returns an error.

However, the returned error type doesn't let the caller to iterate over the errors (e.g. my use case requires me to truncate the list of errors).

Therefore, introducing a backwards-compatible change that exports MultiError type, and guarantees that Wait() method returns an error of this type.

One of the great things about semgroup over x/sync/errgroup is that it
actually waits all tasks to complete and returns an error.

However, the returned error type doesn't let the caller to iterate over the
errors (e.g. my use case requires me to truncate the list of errors).

Therefore, introducing a backwards-compatible change that exports `MultiError`
type, and guarantees that `Wait()` method returns an error of this type.
@fatih
Copy link
Owner

fatih commented Oct 3, 2024

LGTM, I believe I didn't expose it deliberately to force the caller to use errors.Is or errors.As, but it makes sense to expose it. I'll cut a release today.

@fatih fatih merged commit 7b4f395 into fatih:main Oct 3, 2024
1 check passed
@fatih
Copy link
Owner

fatih commented Oct 3, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants