chore(variables): support integer interpolation for all values
This commit is contained in:
parent
acbccb0a93
commit
b40723b0b8
4 changed files with 26 additions and 16 deletions
|
@ -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()[:])
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue