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.
C
Camden Cheek committed
4afefce20f9b00e927315b4c3cdc792fb824780c
Parent: 30a99cd
Committed by GitHub <noreply@github.com>
on 1/8/2024, 6:24:09 PM