mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-31 22:41:53 +02:00
tpl: Improve godoc
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user