Merge pull request #69 from moul/dev/proullon/helpers
feat (helpers): add strings helper
This commit is contained in:
commit
19fd9d7959
@ -78,6 +78,12 @@ var ProtoHelpersFuncMap = template.FuncMap{
|
|||||||
"kebabCase": func(s string) string {
|
"kebabCase": func(s string) string {
|
||||||
return strings.Replace(xstrings.ToSnakeCase(s), "_", "-", -1)
|
return strings.Replace(xstrings.ToSnakeCase(s), "_", "-", -1)
|
||||||
},
|
},
|
||||||
|
"contains": func(sub, s string) bool {
|
||||||
|
return strings.Contains(s, sub)
|
||||||
|
},
|
||||||
|
"trimstr": func(cutset, s string) string {
|
||||||
|
return strings.Trim(s, cutset)
|
||||||
|
},
|
||||||
"snakeCase": xstrings.ToSnakeCase,
|
"snakeCase": xstrings.ToSnakeCase,
|
||||||
"getProtoFile": getProtoFile,
|
"getProtoFile": getProtoFile,
|
||||||
"getMessageType": getMessageType,
|
"getMessageType": getMessageType,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user