Skip to content

Commit

Permalink
types/dynamicpb: fix message Zero return type to read-only
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
emcfarlane authored and dsnet committed Mar 20, 2020
1 parent 2ce1ca9 commit 9d39786
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/dynamicpb/dynamic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9d39786

Please sign in to comment.