fix: ensure pointers can be detected as bools

This required adding a BoolMapperExt interface.
This commit is contained in:
Alec Thomas
2022-11-26 11:20:55 +11:00
parent bf0cbf5d7c
commit 9b08b89396
2 changed files with 49 additions and 18 deletions
+3
View File
@@ -318,6 +318,9 @@ func (v *Value) IsMap() bool {
// IsBool returns true if the underlying value is a boolean.
func (v *Value) IsBool() bool {
if m, ok := v.Mapper.(BoolMapperExt); ok && m.IsBoolFromValue(v.Target) {
return true
}
if m, ok := v.Mapper.(BoolMapper); ok && m.IsBool() {
return true
}