summaryrefslogtreecommitdiffstats
path: root/tpl/cast
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-05-02 11:03:08 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-05-04 10:46:19 +0200
commitcff2f3133442a538f8e125717c5805d58484de88 (patch)
treed1b741ba7133ca879c46f1b69e76de26d4f6b230 /tpl/cast
parentf9e41f6497cac0c47e1446118690e698bb243719 (diff)
tpl: Add some GoDoc info to template func docs
Closes #3418
Diffstat (limited to 'tpl/cast')
-rw-r--r--tpl/cast/cast.go2
-rw-r--r--tpl/cast/docshelper.go2
2 files changed, 3 insertions, 1 deletions
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)