From 2e92f368907c51cfbb2d56c4519604543e2920f5 Mon Sep 17 00:00:00 2001 From: Colin Bate Date: Thu, 2 Jul 2015 15:31:16 -0300 Subject: [PATCH] Add hasPrefix template function. --- tpl/template_funcs.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tpl/template_funcs.go b/tpl/template_funcs.go index 87dde3292..8368bac84 100644 --- a/tpl/template_funcs.go +++ b/tpl/template_funcs.go @@ -1428,6 +1428,7 @@ func init() { "lower": func(a string) string { return strings.ToLower(a) }, "upper": func(a string) string { return strings.ToUpper(a) }, "title": func(a string) string { return strings.Title(a) }, + "hasPrefix": func(a, b string) bool { return strings.HasPrefix(a, b) }, "partial": Partial, "ref": Ref, "relref": RelRef,