the codebase includes a number of fmt.Errorf() calls.
kubeadm and the cluster-api already have moved to using the pkg/errors package instead.
this package is already vendored in kind.
examples:
fmt.Errorf("some error: %v", err) -> errors.Wrap(err, "some message")
fmt.Errorf("object %s; error: %v", objStr, err) -> errors.Wrapf(err, "some object %s; error", objStr)
errors.New("some error") -> errors.New("some error")
// ^ `errors` comes from pkg/errors now
fmt.Errorf("some message %s, objStr) -> errors.Errorf("some message %s", objStr)
note: splitting this into more than one PR might be easier to manage.
e.g at least one for /cmd and one for /pkg.
/kind cleanup
/priority important-longterm
/good-first-issue
/help
@neolit123:
This request has been marked as suitable for new contributors.
Please ensure the request meets the requirements listed here.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.
In response to this:
the codebase includes a number of fmt.Errorf() calls.
kubeadm and the cluster-api already have moved to using the pkg/errors package instead.
this package is already vendored in kind.examples:
fmt.Errorf("some error: %v", err) -> errors.Wrap(err, "some message") fmt.Errorf("object %s; error: %v", objStr, err) -> errors.Wrapf(err, "some object %s; error", objStr) errors.New("some error") -> errors.New("some error") // ^ `errors` comes from pkg/errors now fmt.Errorf("some message %s, objStr) -> errors.Errorf("some message %s", objStr)note: splitting this into more than one PR might be easier to manage.
e.g at least one for /cmd and one for /pkg./kind cleanup
/priority important-longterm
/good-first-issue
/help
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/assign
🤔 pkg/errors in the golang stdlib (as linked) does not contain a Wrap function, only the New function (and the New functions docs recommend using fmt.Errorf for formatting of errors).
I'm assuming this should be github.com/pkg/errors instead?
the link in OP includes:
https://godoc.org/github.com/pkg/errors#Wrap
https://godoc.org/github.com/pkg/errors#Wrapf
...
The link has been edited, @munnerz you saw the link 14 hours ago? 😅
Huuuh, that's weird. Maybe I clicked the link via email? /shrug ignore me! 😄
The link was wrong and I fixed it and pinged Lubomir out of band to let him
know I'd edited it in an attempt to avoid cluttering the issue with
comments about the link 🤣
On Mon, Jan 21, 2019 at 2:58 AM James Munnelly notifications@github.com
wrote:
Huuuh, that's weird. Maybe I clicked the link via email? /shrug ignore me!
😄—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes-sigs/kind/issues/234#issuecomment-456033432,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA4Bq-UQFQJo-MvtoyzKJseEk_Qh7feGks5vFZ1xgaJpZM4aJwKj
.
With these three PRs merged, I don't think we have any fmt.Errorf() left in /cmd or /pkg now, except /pkg/build/base/sources/images_sources.go which was generated by go-bindata.
Thank you!
Most helpful comment
/assign