Documentation
¶
Index ¶
- func CamelCase(s string, enableLint bool) string
- func GetPkgName(path string) string
- func IsExist(paths string) bool
- func Kebab(str string, enableLint bool) string
- func LowTitle(s string) string
- func Recombine(str string, delimiter byte, enableLint bool) string
- func SmallCamelCase(fieldName string, enableLint bool) string
- func SnakeCase(str string, enableLint bool) string
- func UnRecombine(str string, delimiter byte, enableLint bool) string
- func WorkDir() string
- func WriteFile(filename string, data []byte) error
- func WriteFileWithTemplate(filename string, t *template.Template, data any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CamelCase ¶
CamelCase to camel case string id_com -> IDCom idcom -> Idcom name_id_com -> NameIDCom name_idcom -> NameIdcom
func GetPkgName ¶
func IsExist ¶
IsExist checks whether a file or directory exists. It returns false when the file or directory does not exist.
func Kebab ¶
Kebab 转换驼峰字符串为用'-'分隔的字符串,特殊字符由DefaultInitialisms决定取代 example2: delimiter = '-' initialisms = DefaultInitialisms IDCom -> id-com IDcom -> idcom nameIDCom -> name-id-com nameIDcom -> name-idcom
func Recombine ¶
Recombine 转换驼峰字符串为用delimiter分隔的字符串, 特殊字符由DefaultInitialisms决定取代 example: delimiter = '_' 空字符 -> 空字符 HelloWorld -> hello_world Hello_World -> hello_world HiHello_World -> hi_hello_world IDCom -> id_com IDcom -> idcom nameIDCom -> name_id_com nameIDcom -> name_idcom
func SmallCamelCase ¶
SmallCamelCase to small camel case string id_com -> idCom idcom -> idcom name_id_com -> nameIDCom name_idcom -> nameIdcom
func SnakeCase ¶
SnakeCase 转换驼峰字符串为用'_'分隔的字符串,特殊字符由DefaultInitialisms决定取代 example2: delimiter = '_' initialisms = DefaultInitialisms IDCom -> id_com IDcom -> idcom nameIDCom -> name_id_com nameIDcom -> name_idcom
func UnRecombine ¶
UnRecombine 转换sep分隔的字符串为驼峰字符串 example: delimiter = '_' 空字符 -> 空字符 hello_world -> HelloWorld
Types ¶
This section is empty.