-
Notifications
You must be signed in to change notification settings - Fork 286
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
var-naming: don't use leading k in Go names, vague and unclear failure description #867
Comments
Hi @martinsirbe, thanks for filling the issue. |
@chavacava thank you for providing that context. I understand the rationale behind retaining the original behaviour as |
Contributions to the README.md and or the rule's failure message are welcome. |
@chavacava first and foremost, I appreciate the openness to contributions on this matter. I concur that before diving into updating the While acknowledging that I believe there are two potential routes we can consider:
The emphasis here is on ensuring clarity and intuitiveness for users. I'm willing to contribute towards any decision made, whether it's to enhance the documentation or to make changes in the codebase. |
Being a drop-in replacement of
|
Seeing this linter failure message.
The issue with the failure message is that it effectively describes 'what' is wrong, but is vague on explaining 'why' it's wrong. Initially, after some research, I thought the problem might be related to the guideline in idiomatic Go which advises against Hungarian notation. However, upon closer inspection of the code, it's evident that the check is solely for variable names prefixed with a lowercase
k
.revive/rule/var-naming.go
Lines 142 to 150 in b4fc3db
It would be helpful to either annotate the code with comments or refine the failure message to clarify the 'why' behind this check within the
var-naming
rule.As an alternative, perhaps the check should be designed to identify Hungarian notation. Or, maybe it's worth considering the removal of this check altogether?
The text was updated successfully, but these errors were encountered: