mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-04 02:38:50 +00:00
6f9095c675
Rather than having the Converter carry a NewMessage method, have the struct simply expose the MessageType or EnumType since they carry more information and are retrieved anyways as part of the functionality of NewConverter. While changing Converter, export the fields and remove all the methods. Also, add an IsLegacy boolean, which is useful for the later implementation of the extension fields. Add a wrapLegacyEnum function which is used to wrap v1 enums as v2 enums. We use this functionality in NewLegacyConverter to detrive the EnumType. Additionally, modify wrapLegacyMessage to return a protoreflect.ProtoMessage to be consistent with wrapLegacyEnum which must return a protoreflect.ProtoEnum. Change-Id: Idc8989d07e4895d30de4ebc22c9ffa7357815cad Reviewed-on: https://go-review.googlesource.com/c/148827 Reviewed-by: Herbie Ong <herbie@google.com> |
||
---|---|---|
.. | ||
convert.go | ||
map.go | ||
vector.go |