mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-27 22:09:53 +02:00
@@ -307,7 +307,7 @@ func IsTrue(val interface{}) (truth, ok bool) {
|
||||
return isTrue(reflect.ValueOf(val))
|
||||
}
|
||||
|
||||
func isTrue(val reflect.Value) (truth, ok bool) {
|
||||
func isTrueOld(val reflect.Value) (truth, ok bool) {
|
||||
if !val.IsValid() {
|
||||
// Something like var x interface{}, never set. It's a form of nil.
|
||||
return false, true
|
||||
|
@@ -17,6 +17,8 @@ import (
|
||||
"io"
|
||||
"reflect"
|
||||
|
||||
"github.com/gohugoio/hugo/common/hreflect"
|
||||
|
||||
"github.com/gohugoio/hugo/tpl/internal/go_templates/texttemplate/parse"
|
||||
)
|
||||
|
||||
@@ -301,3 +303,7 @@ func (s *state) evalCall(dot, fun reflect.Value, node parse.Node, name string, a
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
func isTrue(val reflect.Value) (truth, ok bool) {
|
||||
return hreflect.IsTruthfulValue(val), true
|
||||
}
|
||||
|
Reference in New Issue
Block a user