Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
letu 2021-05-14 22:57:57 +08:00
commit 402531d68a

View File

@ -618,24 +618,26 @@ func eq(arg1 interface{}, arg2 ...interface{}) (bool, error) {
default: default:
return false, errBadComparison return false, errBadComparison
} }
} else { if truth {
switch k1 { return true, nil
case boolKind:
truth = v1.Bool() == v2.Bool()
case complexKind:
truth = v1.Complex() == v2.Complex()
case floatKind:
truth = v1.Float() == v2.Float()
case intKind:
truth = v1.Int() == v2.Int()
case stringKind:
truth = v1.String() == v2.String()
case uintKind:
truth = v1.Uint() == v2.Uint()
default:
panic("invalid kind")
} }
} }
switch k1 {
case boolKind:
truth = v1.Bool() == v2.Bool()
case complexKind:
truth = v1.Complex() == v2.Complex()
case floatKind:
truth = v1.Float() == v2.Float()
case intKind:
truth = v1.Int() == v2.Int()
case stringKind:
truth = v1.String() == v2.String()
case uintKind:
truth = v1.Uint() == v2.Uint()
default:
return false, errBadComparisonType
}
if truth { if truth {
return true, nil return true, nil
} }