From cff2f3133442a538f8e125717c5805d58484de88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 2 May 2017 11:03:08 +0200 Subject: tpl: Add some GoDoc info to template func docs Closes #3418 --- tpl/cast/cast.go | 2 ++ tpl/cast/docshelper.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'tpl/cast') diff --git a/tpl/cast/cast.go b/tpl/cast/cast.go index d2dfd745f..495e5a14f 100644 --- a/tpl/cast/cast.go +++ b/tpl/cast/cast.go @@ -26,10 +26,12 @@ func New() *Namespace { type Namespace struct { } +// ToInt converts the given value to an int. func (ns *Namespace) ToInt(v interface{}) (int, error) { return _cast.ToIntE(v) } +// ToString converts the given value to a string. func (ns *Namespace) ToString(v interface{}) (string, error) { return _cast.ToStringE(v) } diff --git a/tpl/cast/docshelper.go b/tpl/cast/docshelper.go index 5220ca570..fbbc8c4bb 100644 --- a/tpl/cast/docshelper.go +++ b/tpl/cast/docshelper.go @@ -25,7 +25,7 @@ func init() { docs := make(map[string]interface{}) d := &deps.Deps{} - var namespaces []*internal.TemplateFuncsNamespace + var namespaces internal.TemplateFuncsNamespaces for _, nsf := range internal.TemplateFuncsNamespaceRegistry { nf := nsf(d) -- cgit v1.2.3