diff --git a/handle_slice.go b/handle_slice.go index 6d698bd..68db15e 100644 --- a/handle_slice.go +++ b/handle_slice.go @@ -286,7 +286,7 @@ func validateSlice(anySlice []any, rule *define.FieldRule) error { return fmt.Errorf("%v : data type is slice, min length is [%v], real length is [%v]", rule.Path, *rule.ValueLimit.Min, len(anySlice)) } - if nil != rule.ValueLimit.Max && float64(len(anySlice)) > *rule.ValueLimit.Min { + if nil != rule.ValueLimit.Max && float64(len(anySlice)) > *rule.ValueLimit.Max { return fmt.Errorf("%v : data type is slice, max length is [%v], real length is [%v]", rule.Path, *rule.ValueLimit.Max, len(anySlice)) }