diff --git a/features/pool/pool.go b/features/pool/pool.go index 64d4ba5..efb0f41 100644 --- a/features/pool/pool.go +++ b/features/pool/pool.go @@ -68,7 +68,7 @@ func (p *pool) message(message *protogen.Message) { } p.P(fmt.Sprintf("f%d", len(saved)), ` := m.`, fieldName, `[:0]`) saved = append(saved, field) - } else if field.Oneof != nil { + } else if field.Oneof != nil && !field.Oneof.Desc.IsSynthetic() { if p.ShouldPool(field.Message) { p.P(`if oneof, ok := m.`, field.Oneof.GoName, `.(*`, field.GoIdent, `); ok {`) p.P(`oneof.`, fieldName, `.ReturnToVTPool()`)