commit | 1605775be0bfd4084c40cac4262ada8900791de1 | [log] [tgz] |
---|---|---|
author | Damien Neil <dneil@google.com> | Mon Nov 11 16:30:04 2019 -0800 |
committer | Damien Neil <dneil@google.com> | Tue Nov 12 17:55:36 2019 +0000 |
tree | b39a3c4e5c3472b29f26b58e68d1ea28401b0c0b | |
parent | ce3384cd34a6a398bf3d18f9f13b7d7d09f7d658 [diff] |
internal/impl: handle some dynamic legacy messages When creating a MessageDescriptor for a legacy message with a Descriptor method, we call that method on the type's zero value to get the message's DescriptorProto. Some existing dynamic message types have a Descriptor method which panics in this case. Catch the panic and continue as if the Descriptor method wasn't present. Change-Id: I98d4625d6917cc1ec25737e5670a443f5d02a404 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/206637 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
WARNING: This repository is in active development. There are no guarantees about API stability. Breaking changes will occur until a stable release is made and announced.
This repository is for the development of the next major Go implementation of protocol buffers. This library makes breaking API changes relative to the existing Go protobuf library. Of particular note, this API aims to make protobuf reflection a first-class feature of the API and implements the protobuf ecosystem in terms of reflection.
List of relevant design documents:
We appreciate community contributions. See CONTRIBUTING.md.
Issues regarding the new API can be filed at github.com/golang/protobuf. Please use a APIv2:
prefix in the title to make it clear that the issue is regarding the new API work.