Skip to content

Commit

Permalink
fix: excluded_* and required_* aren't triggered on pointers to structs
Browse files Browse the repository at this point in the history
  • Loading branch information
Irina Starikova committed Jul 14, 2023
1 parent bd1113d commit 5321041
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ func (v *validate) traverseField(ctx context.Context, parent reflect.Value, curr

if !typ.ConvertibleTo(timeType) {

if ct != nil {
for ct != nil {

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

0 comments on commit 5321041

Please sign in to comment.