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

errorsbp: Update for go 1.20 #591

Merged
merged 1 commit into from
Jan 5, 2023
Merged

Conversation

fishy
Copy link
Member

@fishy fishy commented Jan 5, 2023

Go 1.20 is going to add native support for batched/multi errors, and we will be able to eventually deprecate errorsbp.Batch, but we can only do so after we dropped support for go 1.19.

Before that, make errorsbp.Batch play nicer with go 1.20 by:

  • Implement the new Unwrap() []error optional interface.
  • Make errorsbp.BatchSize also support other errors implementing the new optional interface.

@fishy fishy requested a review from a team as a code owner January 5, 2023 17:50
@fishy fishy requested review from kylelemons, pacejackson and ghirsch-reddit and removed request for a team January 5, 2023 17:50
return batch
}(),
},
// TODO: Add cases from errors.Join and fmt.Errorf once we drop support for

This comment was marked as resolved.

@fishy fishy requested a review from pacejackson January 5, 2023 18:18
Copy link
Contributor

@kylelemons kylelemons left a comment

Choose a reason for hiding this comment

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

ah perfect, you already addressed the comment I was about to make 👍

Go 1.20 is going to add native support for batched/multi errors, and we
will be able to eventually deprecate errorsbp.Batch, but we can only do
so after we dropped support for go 1.19.

Before that, make errorsbp.Batch play nicer with go 1.20 by:

* Implement the new `Unwrap() []error` optional interface.
* Make errorsbp.BatchSize also support other errors implementing the new
  optional interface.
@fishy fishy merged commit 1edc07c into reddit:master Jan 5, 2023
@fishy fishy deleted the errorsbp-go-1-20 branch January 5, 2023 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants