Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
rodaine committed Feb 26, 2024
1 parent c27579e commit 3970376
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/evaluator/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,17 +269,17 @@ func (bldr *Builder) processIgnoreEmpty(
val.IgnoreEmpty = forItems && (constraints.GetIgnoreEmpty() ||
constraints.GetIgnore() == validate.Ignore_IGNORE_IF_UNPOPULATED ||
constraints.GetIgnore() == validate.Ignore_IGNORE_IF_DEFAULT_VALUE)
if !val.IgnoreEmpty {
switch {
case !val.IgnoreEmpty:
// only need the zero value for checking ignore_empty constraint
return nil
}
if fdesc.IsList() {
case fdesc.IsList():
msg := dynamicpb.NewMessage(fdesc.ContainingMessage())
val.Zero = msg.Get(fdesc).List().NewElement()
} else if fdesc.Kind() == protoreflect.MessageKind {
case fdesc.Kind() == protoreflect.MessageKind:
msg := dynamicpb.NewMessage(fdesc.Message())
val.Zero = protoreflect.ValueOfMessage(msg)
} else {
default:
val.Zero = fdesc.Default()
}
return nil
Expand Down

0 comments on commit 3970376

Please sign in to comment.