File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -455,7 +455,7 @@ func (field *Field) setupValuerAndSetter() {
455455 // ValueOf returns field's value and if it is zero
456456 fieldIndex := field .StructField .Index [0 ]
457457 switch {
458- case len (field .StructField .Index ) == 1 && fieldIndex > 0 :
458+ case len (field .StructField .Index ) == 1 && fieldIndex >= 0 :
459459 field .ValueOf = func (ctx context.Context , value reflect.Value ) (interface {}, bool ) {
460460 fieldValue := reflect .Indirect (value ).FieldByName (field .Name )
461461 return fieldValue .Interface (), fieldValue .IsZero ()
@@ -504,7 +504,7 @@ func (field *Field) setupValuerAndSetter() {
504504
505505 // ReflectValueOf returns field's reflect value
506506 switch {
507- case len (field .StructField .Index ) == 1 && fieldIndex > 0 :
507+ case len (field .StructField .Index ) == 1 && fieldIndex >= 0 :
508508 field .ReflectValueOf = func (ctx context.Context , value reflect.Value ) reflect.Value {
509509 return reflect .Indirect (value ).Field (fieldIndex )
510510 }
You can’t perform that action at this time.
0 commit comments