-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add strcase package #86
base: main
Are you sure you want to change the base?
Conversation
"unicode" | ||
) | ||
|
||
func ToPascalCase(input string) string { |
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 think something should say that those functions respect the Go initialisms pattern.
Either the package name, the method name, or at the very least the doc
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.
Good point.
I could see something wanting or not wanting the go initialisms.
How about:
ToPascalCase
ToPascalGoCase
ToCamelCase
ToCamelGoCase
ToSnakeCase
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.
👍
- `ToPascalCase`, `ToCamelCase`, and `ToSnakeCase` will transform any input to that form. - Support for unicode runes - Support for all-uppercase initialisms, like mandated by the Go convention. - Expose `IsInitialism` - Emphasis on reducing allocations for memory efficiency.
ToPascalCase
,ToCamelCase
,ToSnakeCase
, andToHeaderField
will transform any input to that form.IsInitialism
SplitJoin
, which can be used for any style of joins.