Documentation
¶
Overview ¶
Package snaker provides methods to convert CamelCase to and from snake_case.
snaker takes into takes into consideration common initialisms (ie, ID, HTTP, ACL, etc) when converting to/from CamelCase and snake_case.
Index ¶
- func AddInitialisms(initialisms ...string) error
- func CamelToSnake(name string) string
- func CamelToSnakeIdentifier(name string) string
- func ForceCamelIdentifier(name string) string
- func ForceLowerCamelIdentifier(name string) string
- func IsInitialism(initialism string) bool
- func SnakeToCamel(name string) string
- func SnakeToCamelIdentifier(name string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddInitialisms ¶
AddInitialisms adds initialisms to the recognized initialisms.
func CamelToSnake ¶
CamelToSnake converts name from camel case ("AnIdentifier") to snake case ("an_identifier").
func CamelToSnakeIdentifier ¶
CamelToSnakeIdentifier converts name from camel case to a snake case identifier.
func ForceCamelIdentifier ¶
ForceCamelIdentifier forces name to its CamelCase specific to Go ("AnIdentifier").
func ForceLowerCamelIdentifier ¶
ForceLowerCamelIdentifier forces the first portion of an identifier to be lower case ("anIdentifier").
func IsInitialism ¶
IsInitialism indicates whether or not an initialism is registered as an identified initialism.
func SnakeToCamelIdentifier ¶
SnakeToCamelIdentifier converts name to its CamelCase identifier (first letter is capitalized).
Types ¶
This section is empty.