We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eecf371 commit 1089aa9Copy full SHA for 1089aa9
vm/runtime/runtime.go
@@ -217,9 +217,12 @@ func In(needle any, array any) bool {
217
if !n.IsValid() || n.Kind() != reflect.String {
218
panic(fmt.Sprintf("cannot use %T as field name of %T", needle, array))
219
}
220
- value := v.FieldByName(n.String())
221
- structValue, ok := v.Type().FieldByName(n.String())
222
- if ok && structValue.Tag.Get("expr") != "-" && value.IsValid() {
+ field, ok := v.Type().FieldByName(n.String())
+ if !ok || !field.IsExported() || field.Tag.Get("expr") == "-" {
+ return false
223
+ }
224
+ value := v.FieldByIndex(field.Index)
225
+ if value.IsValid() {
226
return true
227
228
return false
0 commit comments