Imagine module A imports module B and both use pkg/errors. A uses
errors.Cause to inspect wrapped errors returned from B. As-is, B
cannot migrate from errors.Wrap to fmt.Errorf("%w", err) because
that would break errors.Cause calls in A. With this change merged,
errors.Cause becomes forwards-compatible with Go 1.13 error chains.
Module B will be free to switch to fmt.Errorf("%w", err) and that will
not break module A (so long as the top-level project pulls in the newer
version of pkg/errors).
Imagine module A imports module B and both use
pkg/errors
. A useserrors.Cause
to inspect wrapped errors returned from B. As-is, B cannot migrate fromerrors.Wrap
tofmt.Errorf("%w", err)
because that would breakerrors.Cause
calls in A. With this change merged,errors.Cause
becomes forwards-compatible with Go 1.13 error chains. Module B will be free to switch tofmt.Errorf("%w", err)
and that will not break module A (so long as the top-level project pulls in the newer version ofpkg/errors
).