// eq checks whether x, y are deeply eq
func eq(x, y interface{}) (bool, error) {
// if the y value is numeric (int/int8-int64/float32/float64) then convert to float64
if fv, ok := toFloat64(y); ok {
y = fv
}
return reflect.DeepEqual(x, y), nil
}
// neq checks whether x, y are deeply not equal
func neq(x, y interface{}) (bool, error) {
// if the y value is numeric (int/int8-int64/float32/float64) then convert to float64
if fv, ok := toFloat64(y); ok {
y = fv
}
b, err := eq(x, y)
return !b, err
}
Since y is converted in eq function, there's no need to be converted in neq function, right?
another question: why not let notIn function reuse in function?
Since y is converted in
eq
function, there's no need to be converted in neq function, right?another question: why not let
notIn
function reusein
function?