Closed zombiezen closed 4 years ago
I'm not certain what precisely you include when you say "functions to manipulate field masks", but it would be nice to have the functionality available in Java for merging based on field masks available in Go: https://github.com/google/protobuf/blob/master/java/util/src/main/java/com/google/protobuf/util/FieldMaskUtil.java
Yup! That's what we're talking about. :smiley:
Wouldn't it be possible to change the regen.sh script to build the field_mask.proto, without having the methods to manipulate it ? It's a real pain in go to use the FieldMask, you'll have to get it from github.com/google/go-genproto/protobuf or google.golang.org/genproto/protobuf/field_mask
Any update on this mr @zombiezen ?
We're in the process of making large-scale improvements to Go protobufs. For now, I think we should hold off on additional API for this. I recognize that this is a painpoint for some people, but there's nothing preventing someone from writing a 3rd-party package to wrap this behavior.
I should also note that field mask currently lives outside this repo: https://godoc.org/google.golang.org/genproto/protobuf/field_mask
We probably want to resolve #218 first.
Any update on this? Do we have any recommended util/library method for Go?
@anand-mundada it's not an official library, but I have successfully been using https://github.com/mennanov/fieldmask-utils until there is an official library.
Fixed by https://golang.org/cl/225298. It will be available in the next release of the google.golang.org/protobuf
module, to be released within a week or so.
I should note that there isn't any functionality for using a FieldMask
with merging or serialization to filter in/out fields in a message. That's to come in a future change as there is significant technical work that goes into it.
ptypes has convenience functions for most of the well-known types (WKT), except for FieldMask. This issue tracks adding functions to manipulate field masks.