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 01b16d4 commit 0fa18afCopy full SHA for 0fa18af
vm/runtime/runtime.go
@@ -76,9 +76,8 @@ func Fetch(from, i any) any {
76
t: t,
77
f: fieldName,
78
}
79
- if fi, ok := fieldCache.Load(key); ok {
80
- field := fi.(*reflect.StructField)
81
- return v.FieldByIndex(field.Index).Interface()
+ if cv, ok := fieldCache.Load(key); ok {
+ return v.FieldByIndex(cv.([]int)).Interface()
82
83
field, ok := t.FieldByNameFunc(func(name string) bool {
84
field, _ := t.FieldByName(name)
@@ -94,7 +93,7 @@ func Fetch(from, i any) any {
94
93
if ok {
95
value := v.FieldByIndex(field.Index)
96
if value.IsValid() {
97
- fieldCache.Store(key, &field)
+ fieldCache.Store(key, field.Index)
98
return value.Interface()
99
100
0 commit comments