yeqown / protoc-gen-fieldmask

Generate FieldMask utility functions for protobuf
MIT License
34 stars 9 forks source link

Support repeated and map fields in field_mask #11

Closed vaidasn closed 2 years ago

vaidasn commented 2 years ago

Fixes #1

yeqown commented 2 years ago

changes could not support repeated fields

vaidasn commented 2 years ago

This PR works correctly for my project which has repeated field.

yeqown commented 2 years ago

What result did you get? The changes just want skip the case, how does it support repeated fields?

vaidasn commented 2 years ago

The template is also called recursively from message.tpl#L43. As https://pkg.go.dev/github.com/lyft/protoc-gen-star#FieldType states $f.Type.Embed returns nil for maps and repeated fields.

yeqown commented 2 years ago

I know that, what I really mean is that you'r purpose is fixing it rather than supporting it. Acutally, in my thought the repeated field should be treated as embed field to generate if it is a message type.