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

chore: Remove dependency on multierror #5275

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lukemassa
Copy link
Contributor

@lukemassa lukemassa commented Jan 25, 2025

what

Replace hashicorp's multierror with functionality from the standard library. Also in the edited files, mostly to prevent import naming collisions, replaced pkg/errors with stdlib errors

why

While investigating #5269, I found a number of the more complicated usages of pkg/errors were due to https://github.com/hashicorp/go-multierror.

Go 1.20 introduced errors.Join which essentially has the same functionality as multierror. Even hashicorp itself is working to switch to the stdlib: hashicorp/terraform-provider-aws#32140.

This also cleans up some awkward logic to smooth over the mixed use of standard errors and multierrors.

tests

Ran unit tests.

references

@lukemassa lukemassa requested review from a team as code owners January 25, 2025 21:31
@lukemassa lukemassa requested review from GenPage, nitrocode and X-Guardian and removed request for a team January 25, 2025 21:31
@dosubot dosubot bot added dependencies PRs that update a dependency file go Pull requests that update Go code labels Jan 25, 2025
@lukemassa lukemassa marked this pull request as draft January 25, 2025 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies PRs that update a dependency file go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant