summaryrefslogtreecommitdiff
path: root/pkg/templates.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/templates.go')
-rw-r--r--pkg/templates.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/templates.go b/pkg/templates.go
index 0b7e11b..736bbe0 100644
--- a/pkg/templates.go
+++ b/pkg/templates.go
@@ -3,6 +3,7 @@ package gonf
import (
"bytes"
"log/slog"
+ "strconv"
"text/template"
)
@@ -38,7 +39,9 @@ func (t *TemplateValue) Bytes() []byte {
}
return t.contents
}
-
+func (t TemplateValue) Int() (int, error) {
+ return strconv.Atoi(t.String())
+}
func (t TemplateValue) String() string {
return string(t.Bytes()[:])
}