-
Notifications
You must be signed in to change notification settings - Fork 589
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
pkg: improve field and variable names #2623
base: master
Are you sure you want to change the base?
pkg: improve field and variable names #2623
Conversation
I don't think So if we rename |
Renaming the field is OK, but I don't like not being able to use short variable names (like
|
57e0393
to
1cc6a8a
Compare
Totally agree with you. Renamed to the |
It's okay to use It's not okay to use The Google Go Style Guide contains explanations on variable naming. |
I think it is something to decide on a case-by-case basis. Sometimes the short names work fine, either when their declaration and use case all fits on a single screen, or when the variable is used all the time and not just sparingly. I could go with Note also how |
229dbd3
to
1c7a78e
Compare
Instance *store.Instance | ||
InstConfig *limayaml.LimaYAML |
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.
So this is outside the scope of this PR, but I'm wondering why the BaseDriver
has an InstConfig
field. Isn't that a duplicate of Instance.Config
?
I don't have time to drill into the code right now, but could InstConfig
(nee Yaml
) be replaced with Instance.Config
everywhere? If not, then we should have a comment explaining when/why they can be different.
@balajiv113 Do you remember why you needed both?
@alexandear Please resolve conflicts. @afbjorklund Do you still object to the renaming of local variables in this PR, or was that more a general sentiment. I'll file a separate issue (#2636) to investigate why the |
1c7a78e
to
2fd41a6
Compare
Signed-off-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
2fd41a6
to
41102b6
Compare
This PR renames
y
toinstConfig
becausey
is too short for its usage scope, which broke the CodeReviewComments#variable-names statement: