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

Use joined errors #1610

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from
Open

Use joined errors #1610

wants to merge 1 commit into from

Conversation

skitt
Copy link
Contributor

@skitt skitt commented Aug 22, 2024

Go 1.20 added support for joined errors; using those instead of error slices allows typical nil/non-nil semantics to be used, and allows all error messages to be shown simultaneously when asserting.

Copy link
Member

@fgiorgetti fgiorgetti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Go 1.20 added support for joined errors; using those instead of error
slices allows typical nil/non-nil semantics to be used, and allows all
error messages to be shown simultaneously when asserting.

This gets rid of HandleErrorList, and with it the implied
generic/validation error distinction. To handle that, HandleError
takes an additional error type parameter, making the distinction
explicit.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
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