From 75ba84acbf8469667cb41efa89b81526a18d6a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 15 Jan 2016 23:56:45 +0100 Subject: [PATCH] Add int and string cast template funcs --- tpl/template_funcs.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tpl/template_funcs.go b/tpl/template_funcs.go index 3ef36d694..498a38c5e 100644 --- a/tpl/template_funcs.go +++ b/tpl/template_funcs.go @@ -1507,6 +1507,8 @@ func init() { "relref": RelRef, "apply": Apply, "chomp": Chomp, + "int": func(v interface{}) int { return cast.ToInt(v) }, + "string": func(v interface{}) string { return cast.ToString(v) }, "replace": Replace, "trim": Trim, "dateFormat": DateFormat,