Replies: 1 comment
-
I prefer
Benefits of using only
Negative of switching is the need to change it at lot of places in the codebase. To me switching to stdlib-only errors package doesn't seem to be worth the effort. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Since Go 1.13, there has been error handling support in standard library to wrap errors and check for wrapped error types. This is primarily handled using the
fmt.Errorf
function with the%w
verb. Currently we use thegithub.com/pkg/errors
package which includes similar functionality to the standard library, with the addition of some additional utility functions.In most cases I feel we should move our error wrapping approach to use the standard library since it solves the primary use case of wrapping errors and maintaining the errors type. However, we use the
pkg/errors
package across our code base both internal and vendored packages. I just wanted to create a thread to center discussions around this.Beta Was this translation helpful? Give feedback.
All reactions