mennanov / fieldmask-utils

Protobuf Field Mask Go utils
MIT License
229 stars 26 forks source link

If any messages do not have a subfilter then don't introspect them. #40

Closed artificial-aidan closed 5 months ago

artificial-aidan commented 5 months ago

Allows for unknown anys to be mapped. The current default behavior will always try and unmarshal protobuf any messages, which can cause an issue if the contained message is not in the descriptor pool. This adds an option to only map into any messages if their is a subfield in the mask, which allows copying of an any message as a whole from struct to struct

artificial-aidan commented 5 months ago

I was thinking this might need an option, as it is technically breaking existing behavior, even if it is just erroring on fewer things.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (88c57d8) 86.72% compared to head (6457ef3) 88.16%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #40 +/- ## ========================================== + Coverage 86.72% 88.16% +1.44% ========================================== Files 2 2 Lines 482 490 +8 ========================================== + Hits 418 432 +14 + Misses 46 42 -4 + Partials 18 16 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mennanov commented 5 months ago

Thanks for contributing!