mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-02-20 15:41:07 +00:00
It is a sufficiently common pattern to do something like the following: m.Proto2BytesField, ... = proto.Marshal(m2) where the user is relying on Marshal to never return a nil byte slice, otherwise it subtly changes the semantics of how the generated API handles whether a proto2 "optional bytes" fields is populated or not. Change-Id: Ie7508dbcdcc5f3295885609a91907c6eb4f04c1e Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/228838 Reviewed-by: Damien Neil <dneil@google.com>