Skip to content

Commit

Permalink
fix: check oneof on syntetic
Browse files Browse the repository at this point in the history
  • Loading branch information
evgfedotov committed Nov 20, 2023
1 parent 641a874 commit 7894a28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion features/pool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()`)
Expand Down

0 comments on commit 7894a28

Please sign in to comment.