summaryrefslogtreecommitdiffstats
path: root/tpl/cast
diff options
context:
space:
mode:
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)