Documentation
¶
Index ¶
- Variables
- func ToCamelCase(input string) string
- func ToKebabCase(input string) string
- func ToKebabCaseLower(input string) string
- func ToLower(input string) string
- func ToPascalCase(input string, extraAbbreviations ...string) string
- func ToPascalCaseTitledAbbreviations(input string) string
- func ToSnakeCase(input string) string
- func ToSnakeCaseLower(input string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var CommonInitialisms = map[string]bool{ "ACL": true, "API": true, "ASCII": true, "CPU": true, "CSS": true, "DNS": true, "EOF": true, "GUID": true, "HTML": true, "HTTP": true, "HTTPS": true, "ID": true, "IP": true, "JSON": true, "LHS": true, "QPS": true, "RAM": true, "RHS": true, "RPC": true, "SLA": true, "SMTP": true, "SQL": true, "SSH": true, "TCP": true, "TLS": true, "TTL": true, "UDP": true, "UI": true, "UID": true, "UUID": true, "URI": true, "URL": true, "UTF8": true, "VM": true, "XML": true, "XMPP": true, "XSRF": true, "XSS": true, }
CommonInitialisms is the set of common initialisms that should remain fully uppercased in PascalCase output. Derived from Go's standard initialisms list.
Functions ¶
func ToCamelCase ¶
func ToKebabCase ¶
func ToKebabCaseLower ¶
func ToPascalCase ¶
ToPascalCase converts any input format (snake_case, kebab-case, camelCase, PascalCase) to PascalCase while fully uppercasing word segments that match known common initialisms (ID, URL, API, etc.).
Uses whole-segment matching on underscore-delimited words, so abbreviations within longer words are never matched (e.g., "sidney" does not match "ID").
Extra abbreviations beyond CommonInitialisms can be passed via the variadic parameter.
func ToSnakeCase ¶
func ToSnakeCaseLower ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.