Closed ultimaweapon closed 6 years ago
This will have more convenience when we want to return a new simple error from a function that aggregated with the cause. Something like this:
func foo() error { if err := bar(); err != nil { return multierror.Append("failed to bar", err) } }
Thanks for the PR but I don't love the ambiguity here. It isn't much effort to errors.New or fmt.Errorf (I understand it introduces an import line, but at least its just stdlib). Sorry!
errors.New
fmt.Errorf
This will have more convenience when we want to return a new simple error from a function that aggregated with the cause. Something like this: