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 {
791791 case reflect .Slice , reflect .Map , reflect .Array :
792792 return int64 (field .Len ()) != int64 (currentField .Len ())
793793
794+ case reflect .Bool :
795+ return field .Bool () != currentField .Bool ()
796+
794797 case reflect .Struct :
795798
796799 fieldType := field .Type ()
Original file line number Diff line number Diff line change @@ -4589,6 +4589,7 @@ func TestIsNeFieldValidation(t *testing.T) {
45894589 i := 1
45904590 j = 1
45914591 k = 1.543
4592+ b := true
45924593 arr := []string {"test" }
45934594 now := time .Now ().UTC ()
45944595
@@ -4598,6 +4599,7 @@ func TestIsNeFieldValidation(t *testing.T) {
45984599 i2 := 3
45994600 j2 = 2
46004601 k2 = 1.5434456
4602+ b2 := false
46014603 arr2 := []string {"test" , "test2" }
46024604 arr3 := []string {"test" }
46034605 now2 := now
@@ -4614,6 +4616,9 @@ func TestIsNeFieldValidation(t *testing.T) {
46144616 errs = validate .VarWithValue (k2 , k , "nefield" )
46154617 Equal (t , errs , nil )
46164618
4619+ errs = validate .VarWithValue (b2 , b , "nefield" )
4620+ Equal (t , errs , nil )
4621+
46174622 errs = validate .VarWithValue (arr2 , arr , "nefield" )
46184623 Equal (t , errs , nil )
46194624
You can’t perform that action at this time.
0 commit comments