-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Go 1.13 error wrapping #2308
Comments
@joelanford I can take a shot at this. This will be my first contribution and hence I may take some time. Please let me know if its fine. |
@nrchakradhar Awesome thanks! We would welcome this contribution! |
@joelanford I hope I have understood the changes to be done. I have written a script that does the change for fmt.ErrorF. I will put some samples here tomorrow. If it looks fine, I will commit the changes. Thanks for providing me an opportunity to contribute. |
@joelanford
|
Use fmt.Errorf as per 1.13. Changed errors.Wrap and errors.Wrapf to use fmt.Errorf. Fixes operator-framework#2308
Use fmt.Errorf as per 1.13. Changed errors.Wrap and errors.Wrapf to use fmt.Errorf. Fixes operator-framework#2308
Use fmt.Errorf as per 1.13. Changed errors.Wrap and errors.Wrapf to use fmt.Errorf. Fixes operator-framework#2308
Use fmt.Errorf as per 1.13. Changed errors.Wrap and errors.Wrapf to use fmt.Errorf. Fixes operator-framework#2308
Use fmt.Errorf as per 1.13. Changed errors.Wrap and errors.Wrapf to use fmt.Errorf. Fixes operator-framework#2308
Use fmt.Errorf as per 1.13. Changed errors.Wrap and errors.Wrapf to use fmt.Errorf. Fixes operator-framework#2308
Now that we've upgraded to Go 1.13, we should find instances in our code base of:
errors.Wrap()
,errors.Wrapf()
, and replace them withfmt.Errorf()
with%w
.fmt.Errorf()
calls that wrap an error, but use%s
or%v
, and replace them withfmt.Errorf()
with%w
github.com/pkg/errors
package should be transitioned over to Go's standard libraryerrors
package, if possible.All
fmt.Errorf()
calls that wrap an error should look like the following:%w
should be preceded by:
(colon space)%w
should not be in parenthesesThe text was updated successfully, but these errors were encountered: