commit | 14ac241a9605054dd8338e08fa5a8c7d9ad20f73 | [log] [tgz] |
---|---|---|
author | Joe Tsai <joetsai@digital-static.net> | Fri Jan 03 20:18:06 2020 -0800 |
committer | Joe Tsai <thebrokentoaster@gmail.com> | Mon Jan 06 19:10:59 2020 +0000 |
tree | c10d7d2d551a96e3899bf61f5ed817635222184e | |
parent | 6c26a04a514d59c666df383eba3d417132b9fcf6 [diff] |
internal/impl: return nil for nil enum or message Ensure that EnumOf, EnumDescriptorOf, EnumTypeOf, ProtoMessageV1Of, ProtoMessageV2Of, MessageOf, MessageDescriptorOf, and MessageTypeOf all return nil if passed a nil interface. This parallels the behavior of reflect.TypeOf or reflect.ValueOf, which return nil or an invalid value rather than panicking. Change-Id: I461f15542f16cb0922d627bca6fcad5fc27d87e2 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/213239 Reviewed-by: Damien Neil <dneil@google.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.