-
Notifications
You must be signed in to change notification settings - Fork 85
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
Adds helper functions #116
Adds helper functions #116
Conversation
Hi @somtochiama. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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 @justinsb |
pkg/patterns/addon/pkg/loaders/fs.go
Outdated
version, err := utils.GetCommonVersion(object) | ||
componentName, err = utils.GetCommonName(object) | ||
channelName, err = utils.GetCommonChannel(object) | ||
// All the errors above are checking the same thing? Is there a better way? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a pattern that is sometimes used in parsing https://blog.golang.org/errors-are-values
However in this case because the methods are different it's better just to repeat the if err != nil
block 3 times.
It might be we combine GetCommonName / GetCommonVersion / GetCommonChannel into GetCommonSpec in future, in which case we'd only have one error check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great article! I always wondered about the frequency of if err != nil
.
One note on the error checking, but otherwise lgtm. Looks like a small conflict on one of the files, but in advance of fixing that and the error checking... /approve |
aa1b4ac
to
da25769
Compare
Thanks @somtochiama /ok-to-test |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justinsb, SomtochiAma The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
No description provided.