types/dynamicpb: fix message Zero return type to read-only

Changes the message Zero return type to be read-only by omitting internal known map.

Change-Id: I1c1191a125df74251be3d8bb70f4b06c1ff57070
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/223857
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
This commit is contained in:
Edward McFarlane 2020-03-17 23:54:49 +00:00 committed by Joe Tsai
parent 2ce1ca9e3f
commit 9d397869d8

View File

@ -323,7 +323,7 @@ func NewMessageType(desc pref.MessageDescriptor) pref.MessageType {
}
func (mt messageType) New() pref.Message { return NewMessage(mt.desc) }
func (mt messageType) Zero() pref.Message { return NewMessage(mt.desc) }
func (mt messageType) Zero() pref.Message { return &Message{typ: messageType{mt.desc}} }
func (mt messageType) Descriptor() pref.MessageDescriptor { return mt.desc }
type emptyList struct {