@ -1106,6 +1106,11 @@ func isEq(fl FieldLevel) bool {
p := asFloat(param)
return field.Float() == p
case reflect.Bool:
p := asBool(param)
return field.Bool() == p
}
panic(fmt.Sprintf("Bad field type %T", field.Interface()))
@ -249,6 +249,16 @@ func asFloat(param string) float64 {
return i
// asBool returns the parameter as a bool
// or panics if it can't convert
func asBool(param string) bool {
i, err := strconv.ParseBool(param)
panicIf(err)
func panicIf(err error) {
if err != nil {
panic(err.Error())