Documentation
¶
Index ¶
- func Atoi(s string) (int, error)
- func LowerCamelCase(name string) string
- func LowerDashJoint(name string) string
- func LowerSnakeCase(name string) string
- func Random(n int) string
- func RandomN(n int) string
- func SplitCamelCase(src string) (parts []string)
- func SplitToWords(s string) []string
- func UpperCamelCase(name string) string
- func UpperSnakeCase(name string) string
- func ValidFlagKey(s string) bool
- func ValidFlagName(s string) bool
- func ValidFlagOptionKey(s string) bool
- func ValidIdentifier(s string) bool
- func ValidUnquotedOptionValue(s string) bool
- type LetterType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LowerDashJoint ¶
LowerDashJoint e.g. i-am-a-10-years-senior
func LowerSnakeCase ¶
LowerSnakeCase e.g. i_am_a_10_years_senior
func SplitCamelCase ¶ added in v0.4.1
SplitCamelCase splits the camelcase word and returns a list of words. It also supports digits. Both lower camel case and upper camel case are supported. For more info please check: http://en.wikipedia.org/wiki/CamelCase Splitting rules
- If string is not valid UTF-8, return it without splitting as single item array.
- Assign all Unicode characters into one of 4 sets: lower case letters, upper case letters, numbers, and all other characters.
- Iterate through characters of string, introducing splits between adjacent characters that belong to different sets.
- Iterate through array of split strings, and if a given string is upper case: if subsequent string is lower case: move last character of upper case string to beginning of lower case string
func SplitToWords ¶
func UpperSnakeCase ¶
UpperSnakeCase e.g. I_AM_A_10_YEARS_SENIOR
func ValidFlagKey ¶ added in v0.2.0
func ValidFlagName ¶ added in v0.2.0
func ValidFlagOptionKey ¶ added in v0.2.0
func ValidIdentifier ¶ added in v0.2.0
func ValidUnquotedOptionValue ¶ added in v0.2.0
Types ¶
type LetterType ¶
type LetterType int
Click to show internal directories.
Click to hide internal directories.