protobuf-go/internal/cmd
Joe Tsai 4532dd7969 internal/fileinit: prevent map entry descriptors from implementing MessageType
The protobuf type system hacks the representation of map entries into that
of a pseudo-message descriptor.

Previously, we made all message descriptors implement MessageType
where type descriptors had a GoType method that simply returned nil.
Unfortunately, this violates a nice property in the Go type system
where being able to assert to a MessageType guarantees that Go type
information is truly associated with that descriptor.

This CL makes it such that message descriptors for map entries
do not implement MessageType.

Change-Id: I23873cb71fe0ab3c0befd8052830ea6e53c97ca9
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/168399
Reviewed-by: Damien Neil <dneil@google.com>
2019-03-21 17:47:49 +00:00
..
generate-protos internal/fieldnum: generate field numbers for the google.protobuf package 2019-03-21 00:57:40 +00:00
generate-types internal/fileinit: prevent map entry descriptors from implementing MessageType 2019-03-21 17:47:49 +00:00
pbdump internal/prototype: move from reflect/prototype 2019-03-13 20:17:00 +00:00