From 07992907fd0598daaeb3c7864b0ca8e71315bf79 Mon Sep 17 00:00:00 2001 From: Pierre Roullon Date: Mon, 26 Jun 2017 11:34:02 +0200 Subject: [PATCH] feat (helpers): add strings helper --- helpers/helpers.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/helpers/helpers.go b/helpers/helpers.go index 2f8cdcb..fd9612d 100644 --- a/helpers/helpers.go +++ b/helpers/helpers.go @@ -78,6 +78,12 @@ var ProtoHelpersFuncMap = template.FuncMap{ "kebabCase": func(s string) string { 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, "getProtoFile": getProtoFile, "getMessageType": getMessageType,