Skip to content

replace harshicorp/multierror with errors.Join #1921

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

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

djdongjin
Copy link
Member

@djdongjin djdongjin commented Jan 6, 2025

As titled. The replacement is done by:

  1. a multierror error (allErr) -> var errs []error
  2. multierror.Append(allErr, err) -> errs = append(errs, err)
  3. return allErr -> return errors.Join(errs)

And if errs is empty slice or if every error in errs are nil, return errors.Join(errs) will also return a nil error.

Copy link
Member

@ktock ktock left a comment

Choose a reason for hiding this comment

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

Thanks

@ktock ktock merged commit d8470f9 into containerd:main Jan 6, 2025
2 checks passed
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