From 2d8d05044c2ce0f38d3e7af7eef3ce0ff6c61b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Thu, 16 May 2024 20:44:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E7=BB=84=E6=9C=80?= =?UTF-8?q?=E5=A4=A7=E9=95=BF=E5=BA=A6=E9=AA=8C=E8=AF=81=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handle_slice.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) }