Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Concurrent functions return multiple errors. These are now returned only as either a channel or a slice. This avoids a dependency on a 3rd party multi errors library. The standard library errors.Join is awkward to use because there is not a simple way to unwrap the errors. We could use a custom multi error. However, to make this convenient to use it should be returned as a pointer to the struct rather than an opaque error. But Go has a subtle design issue where an interface can end up being non-nil when storing a pointer to a struct. Returning []error still allows the caller to use errors.Join() if they don't care about iterating the individual errors. The main issue is that someone may check != nil rather than len > 0 However, all the APIs are designed to return nil rather than a zero length slice. Additionally, don't use the default recovery handler. Write more errors to the error channels. Panic a few errors that shouldn't happen.
- Loading branch information