3 ms·
github.com/pkg/errors is a popular solution to this problem
by alecthomas 7y ago
github.com/pkg/errors is a popular solution to this problem
- oppositelock 7y agoIndeed! In my opinion, Dave Cheney's error package is a better design than the Go 1.13 built-in mechanism, because it's more explicit. It's easy to forget a %w after being so used to %v, but errors.Wrap(err, ...) is pretty darn clear, as is errors.Unwrap.