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

cmdutil: Support errors.Join-based multi-errors #13813

Merged
merged 1 commit into from Sep 1, 2023

Commits on Sep 1, 2023

  1. cmdutil: Support errors.Join-based multi-errors

    cmdutil has some special handling for hashicorp/go-multierror
    so that multi-errors are printed cleanly in the form:
    
        %d errors occurred:
            1) foo
            2) bar
            ...
    
    In Go 1.20, the errors package got a native `errors.Join` function.
    This adds support for errors.Join-based multi-errors to this logic.
    
    These errors implement an `Unwrap() []error` method
    which can be used to access the full list of errors.
    We use that and then implement the same logic for formatting as before.
    abhinav committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    b7fd2ec View commit details
    Browse the repository at this point in the history