24 lines
456 B
Go
24 lines
456 B
Go
|
package tmpl
|
||
|
|
||
|
import (
|
||
|
"reflect"
|
||
|
_ "unsafe"
|
||
|
)
|
||
|
|
||
|
//go:linkname indirectInterface text/template.indirectInterface
|
||
|
//go:nosplit
|
||
|
func indirectInterface(v reflect.Value) reflect.Value
|
||
|
|
||
|
//go:linkname truth text/template.truth
|
||
|
//go:nosplit
|
||
|
func truth(arg reflect.Value) bool
|
||
|
|
||
|
//go:linkname isTrue text/template.isTrue
|
||
|
//go:nosplit
|
||
|
func isTrue(arg reflect.Value) (truth, ok bool)
|
||
|
|
||
|
func evalTrue(val reflect.Value) (truth bool) {
|
||
|
truth, _ = isTrue(val)
|
||
|
return
|
||
|
}
|