mennanov / fmutils

Golang protobuf FieldMask missing utils
MIT License
109 stars 11 forks source link

Add support for repeated message fields. #2

Closed mennanov closed 3 years ago

mennanov commented 3 years ago

Add support for repeated message fields so that if given a Profile message:

message Photo {
  int64 photo_id = 1;
  string path = 2;
  Dimensions dimensions = 3;
}

message Dimensions {
  int32 width = 1;
  int32 height = 2;
}

message Profile {
  User user = 1;
  Photo photo = 2;
  repeated int64 login_timestamps = 3;
  repeated Photo gallery = 4;
}

and a mask like "gallery.photo_id", "gallery.dimensions.height" the Filter() function will keep those fields in the repeated field gallery.

codecov[bot] commented 3 years ago

Codecov Report

Merging #2 (a860b57) into main (9e8bf86) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main        #2   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           51        62   +11     
=========================================
+ Hits            51        62   +11     
Impacted Files Coverage Δ
fmutils.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9e8bf86...a860b57. Read the comment docs.

SachsA commented 3 years ago

Thank you for this update! It works like a charm!