tpl: Improve godoc

This commit is contained in:
Bjørn Erik Pedersen
2022-04-30 18:12:08 +02:00
parent a6d545854a
commit 6eea32bd6b
8 changed files with 142 additions and 141 deletions

View File

@@ -29,18 +29,18 @@ func New() *Namespace {
type Namespace struct {
}
// ToInt converts the given value to an int.
// ToInt converts v to an int.
func (ns *Namespace) ToInt(v any) (int, error) {
v = convertTemplateToString(v)
return _cast.ToIntE(v)
}
// ToString converts the given value to a string.
// ToString converts v to a string.
func (ns *Namespace) ToString(v any) (string, error) {
return _cast.ToStringE(v)
}
// ToFloat converts the given value to a float.
// ToFloat converts v to a float.
func (ns *Namespace) ToFloat(v any) (float64, error) {
v = convertTemplateToString(v)
return _cast.ToFloat64E(v)