This project is now archived since go1.20 is out and allows usage of errors.Join
migrating is as simple as switching multierror.Append to errors.Join
a simple package for handling horizontal errors as opposed to veritical (fmt.Errorf %w error wrapping)
Usage example from goreinstall:
func getGoBinaryInfo(ctx context.Context, path string) (info *buildinfo.BuildInfo, err error) {
...
defer func() {
if err2 := f.Close(); err2 != nil {
err = multierror.Append(err, fmt.Errorf("file could not be closed due to error (%w)", err2))
}
}()
...
}