Skip to content

Commit

Permalink
pkg/config/validate.go: check CanInterface on subitems correctly (#918)
Browse files Browse the repository at this point in the history
  • Loading branch information
cfal authored Nov 6, 2024
1 parent f1c901f commit c7bded1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/config/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func validate(v reflect.Value, checkInterface bool) (err error) {
for iter.Next() {
mk := iter.Key()
mv := iter.Value()
if !v.CanInterface() {
if !mv.CanInterface() {
continue
}
if mv.Kind() == reflect.Ptr && mv.IsNil() {
Expand All @@ -92,7 +92,7 @@ func validate(v reflect.Value, checkInterface bool) (err error) {
case reflect.Slice, reflect.Array:
for i := 0; i < v.Len(); i++ {
iv := v.Index(i)
if !v.CanInterface() {
if !iv.CanInterface() {
continue
}
if iv.Kind() == reflect.Ptr && iv.IsNil() {
Expand Down

0 comments on commit c7bded1

Please sign in to comment.