diff --git a/msgpack/field.go b/msgpack/field.go index de7abc7f..69c3bbb0 100644 --- a/msgpack/field.go +++ b/msgpack/field.go @@ -74,6 +74,8 @@ func collectFields(fields []*field, t reflect.Type, visited map[reflect.Type]boo } if len(index) == d { + _ = fields[len(fields)-1] // bounds check hint to compiler + // There is another field with same name and same depth // Remove that field and skip this field j := 0