-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix enum capitalization #2630
fix enum capitalization #2630
Conversation
if commonInitialisms[strings.ToUpper(word)] { | ||
upperWord := strings.ToUpper(word) | ||
if commonInitialisms[upperWord] { | ||
switch upperWord { |
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.
switch upperWord { | |
// If the uppercase word (string(runes[w:i]) is "ID" or "IP" | |
// AND | |
// the word is the first two characters of the str | |
// AND | |
// that is not the end of the word | |
// AND | |
// the length of the string is greater than 3 | |
// AND | |
// the third rune is an uppercase one | |
// THEN | |
// do NOT count this as an initialism. | |
switch upperWord { |
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.
Thank you for your suggestion!
I applied it and pushed.
Thanks! It took me a little while to understand what this code was doing. I suggested adding a comment (which will probably need to be indented differently), because in the future it may help someone to make this a more general fix than just for ID and IP. |
Thanks for making this improvement! Keep them coming! |
Agree. I worried while I was writing this PR because it looks too tricky.
Thank you for accepting. I look forward to meet again on PR! |
First of all, sorry for my bad english.
In my case, I want to use
IDLE
and it should beIdle
. But the generated output shows meIDLe
.And I found similar issue #2469. So I try to satisfy both.
I have: