Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multierror: join errors at the end (#132)
This fixes `MapErr` so that it does not create recursive `joinError`s. By repeatedly calling `errors.Join(`, we create a nested set of `joinError`s rather than a single, flat `joinError`. Then, when `Error()` is called, it allocates a new string for each nested error because `joinError` calls `Error()` recursively on each of its children. Instead, this PR updates `MapErr` to just collect a slice of errors and return the flat joined error.
- Loading branch information