-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
strings: Title and ToTitle have similar names but do different things #37235
Comments
@gopherbot please add label Go2 |
I think you're right that the names of these two functions are confusing but I don't really know what else they could have called them which would have been less so.
However, it's useful to have a function which capitalizes the first letter of each word and they've gone here for I suppose they could have called it An argument for using Perhaps the best solution now would be to expand a bit in the documentation about what the differences are rather than change |
Maybe the names are poorly chosen but they do exist, they do work, and they are documented. It's not worth changing at this point. Even for Go 2 we don't want to arbitrarily break existing code. (If we do anything here, personally I think we should deprecate |
Title
returns a copy of the string s with all Unicode letters that begin words mapped to their Unicode title case.ToTitle
returns a copy of the string s with all Unicode letters mapped to their Unicode title case.Ideally (Go2) they should have completely different names.
The text was updated successfully, but these errors were encountered: