File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -791,6 +791,9 @@ func isNeField(fl FieldLevel) bool {
791
791
case reflect .Slice , reflect .Map , reflect .Array :
792
792
return int64 (field .Len ()) != int64 (currentField .Len ())
793
793
794
+ case reflect .Bool :
795
+ return field .Bool () != currentField .Bool ()
796
+
794
797
case reflect .Struct :
795
798
796
799
fieldType := field .Type ()
Original file line number Diff line number Diff line change @@ -4589,6 +4589,7 @@ func TestIsNeFieldValidation(t *testing.T) {
4589
4589
i := 1
4590
4590
j = 1
4591
4591
k = 1.543
4592
+ b := true
4592
4593
arr := []string {"test" }
4593
4594
now := time .Now ().UTC ()
4594
4595
@@ -4598,6 +4599,7 @@ func TestIsNeFieldValidation(t *testing.T) {
4598
4599
i2 := 3
4599
4600
j2 = 2
4600
4601
k2 = 1.5434456
4602
+ b2 := false
4601
4603
arr2 := []string {"test" , "test2" }
4602
4604
arr3 := []string {"test" }
4603
4605
now2 := now
@@ -4614,6 +4616,9 @@ func TestIsNeFieldValidation(t *testing.T) {
4614
4616
errs = validate .VarWithValue (k2 , k , "nefield" )
4615
4617
Equal (t , errs , nil )
4616
4618
4619
+ errs = validate .VarWithValue (b2 , b , "nefield" )
4620
+ Equal (t , errs , nil )
4621
+
4617
4622
errs = validate .VarWithValue (arr2 , arr , "nefield" )
4618
4623
Equal (t , errs , nil )
4619
4624
You can’t perform that action at this time.
0 commit comments