https://go.dev/blog/go1.13-errors
https://pkg.go.dev/errors#As
Don’t:
1 | func isPairingNotFound(err error) bool { |
Do:
1 | import ( |
The Unwrap, Is and As functions work on errors that may wrap other errors. An error wraps another error if its type has the method
Unwrap() error
Ife.Unwrap()
returns a non-nil error w, then we say that e wraps w.