Documentation ¶
Index ¶
- func CamelCase(s string) string
- func Kebab(str string, enableLint bool) string
- func LowTitle(s string) string
- func ProtocVersion(gen *protogen.Plugin) 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CamelCase ¶
CamelCase returns the CamelCased name. If there is an interior underscore followed by a lower case letter, drop the underscore and convert the letter to upper case. There is a remote possibility of this rewrite causing a name collision, but it's so remote we're prepared to pretend it's nonexistent - since the C++ generator lowercases names, it's extremely unlikely to have two fields with different capitalizations. In short, _my_field_name_2 becomes XMyFieldName_2.
func Kebab ¶
Kebab 转换驼峰字符串为用'-'分隔的字符串,特殊字符由DefaultInitialisms决定取代 example2: delimiter = '-' initialisms = DefaultInitialisms IDCom -> id-com IDcom -> idcom nameIDCom -> name-id-com nameIDcom -> name-idcom
func ProtocVersion ¶
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
Types ¶
This section is empty.