You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
zap opted to avoid handling this by itself. Relying on formatting the error with %+v into errorVerbose , which means the error type needs to implement that to be printed nicely by it. (With no documentation on how to do so properly, and with each library doing it slightly differently, yay Go!). That doesn't mean it can't be done of course. Just something to know about.
Another thing is that due to Go deficiencies it is common to wrap errors with various error wrappers that add things like a stack trace (e.g. github.com/pkg/errors.WrapStack). By just walking the error chain, you will also walk over that type, which delegates to the wrapped error and will cause its message to be printed twice unless it will be handled specially.
Add support for
errors.Unwrap(err error) error
errors.Cause(err error) error
The text was updated successfully, but these errors were encountered: