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 3196510 commit 6cc56e7Copy full SHA for 6cc56e7
vm/runtime/runtime.go
@@ -80,11 +80,9 @@ type Field struct {
80
81
func FetchField(from any, field *Field) any {
82
v := reflect.ValueOf(from)
83
- kind := v.Kind()
84
- if kind != reflect.Invalid {
85
- if kind == reflect.Ptr {
86
- v = reflect.Indirect(v)
87
- }
+ if v.Kind() != reflect.Invalid {
+ v = reflect.Indirect(v)
+
88
// We can use v.FieldByIndex here, but it will panic if the field
89
// is not exists. And we need to recover() to generate a more
90
// user-friendly error message.
0 commit comments