3 ms·
There's already a good library like that: https://github.com/pkg/errors https://github.com/pkg/errors It is API-compatible with the errors package, and you get
by lobster_johnson 10y ago
There's already a good library like that: https://github.com/pkg/errors https://github.com/pkg/errors
It is API-compatible with the errors package, and you get errors.Wrap(err, message), errors.Wrapf(err, message, args) and errors.Cause(err).
- voidlogic 10y agoWe wrote ours around the time Go 1.1 was released so its way older and featureful than that package.