Skip to content

Commit

Permalink
fix behavior for nostructlevel
Browse files Browse the repository at this point in the history
  • Loading branch information
Irina Starikova committed Jul 14, 2023
1 parent 5321041 commit cb8c343
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,10 @@ func (v *validate) traverseField(ctx context.Context, parent reflect.Value, curr

for ct != nil {

if ct.typeof == typeStructOnly || ct.typeof == typeNoStructLevel {
if ct.typeof == typeStructOnly {
goto CONTINUE
} else if ct.typeof == typeNoStructLevel {
break
} else if ct.typeof == typeIsDefault || ct.typeof == typeDefault && ct.runValidationWhenNil && v.fldIsPointer {
// set Field Level fields
v.slflParent = parent
Expand Down

0 comments on commit cb8c343

Please sign in to comment.