feat(codegen): Preserve casing of names by uppercasing the first character...#4210
feat(codegen): Preserve casing of names by uppercasing the first character...#4210theAnuragMishra wants to merge 1 commit intosqlc-dev:mainfrom
Conversation
| if len(p) > 0 { | ||
| out += strings.ToUpper(p[:1]) + p[1:] | ||
| } |
There was a problem hiding this comment.
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.
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.
What does it have to do with the existence of whitespace?
There was a problem hiding this comment.
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.
strings.Title already does what we want here. #4202 (comment)
… character instead of using strings.Title
and leaving the rest in their original case.
closes #4202