Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add strcase package #86

wants to merge 4 commits into from

Conversation

lavoiesl
Copy link
Contributor

@lavoiesl lavoiesl commented Jan 26, 2021

  • ToPascalCase, ToCamelCase, ToSnakeCase, and ToHeaderField will transform any input to that form.
  • Support for unicode runes
  • Support for all-uppercase initialisms, like mandated by the Go convention.
  • Expose IsInitialism
  • Expose SplitJoin, which can be used for any style of joins.
  • Emphasis on reducing allocations for memory efficiency.

"unicode"
)

func ToPascalCase(input string) string {
Copy link
Member

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

Copy link
Contributor Author

@lavoiesl lavoiesl Mar 31, 2021

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

Copy link
Member

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants