Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
wln32 committed Jan 3, 2025
1 parent c43c234 commit bfa2f67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions util/gvalid/gvalid_validator_check_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,21 +287,21 @@ func (v *Validator) doCheckValueRecursively(ctx context.Context, in doCheckValue
}

case reflect.Slice, reflect.Array:
loopValid := false
loop := false
switch in.Type.Elem().Kind() {
// []struct []map
case reflect.Struct, reflect.Map:
loopValid = true
loop = true
case reflect.Ptr:
// []*struct
// []*int
loopValid = true
loop = true
}
// When it is a base type array,
// there is no need for recursive loop validation,
// otherwise it will cause memory leakage
// https://github.com/gogf/gf/issues/4092
if loopValid {
if loop {
var array []interface{}
if gjson.Valid(in.Value) {
array = gconv.Interfaces(gconv.Bytes(in.Value))
Expand Down

0 comments on commit bfa2f67

Please sign in to comment.