-
Notifications
You must be signed in to change notification settings - Fork 988
feat(codegen): Preserve casing of names by uppercasing the first character... #4210
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
Conversation
... character instead of using strings.Title
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 isn't any whitespace in p (see line 31 above), so this code will do the same thing as strings.Title.
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.
Ah, actually, slicing off the first byte would split up a multi-byte character, and fail to convert it. The existing call to strings.Title will properly uppercase a multi-byte character.
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.
What does it have to do with the existence of whitespace?
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.
I do agree on the problem with multibyte characters though.
We can split the string in runes and convert the first rune in that case? Not sure how uppercasing works with multibyte chars, gotta find out.
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.
strings.Title already does what we want here. #4202 (comment)
and leaving the rest in their original case.
closes #4202