Refactor interface type check to more idiomatic syntax - #17951
Conversation
|
Hi @rramkumar1. Thanks for your PR. I'm waiting for a kubernetes 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. DetailsInstructions 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-sigs/prow repository. |
a622cf8 to
db91ade
Compare
|
@hakman Any thoughts on this PR? |
|
Thanks @rramkumar1, seems like a nice change. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hakman The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@rramkumar1: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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-sigs/prow repository. I understand the commands that are listed here. |
The end behavior is the same but casting the underlying struct type to a nil pointer is more idiomatic that declaring a pointer to an empty struct.
This isn't something that's explicity mentioned in the Go style guide but has been adopted as a common pattern (e.g https://github.com/uber-go/guide/blob/master/style.md#verify-interface-compliance)
(Note: I did manually edit one file and then prompt an LLM to do the rest for me)
/assign @hakman