cmd/protoc-gen-go: remove generation of {Unmarshal,Marshal}JSON for MessageSets

PR#741 in the v1 repository deprecated this behavior.

Change-Id: Idffa3884d43f9cc5528ce8d9f303676e0e501b67
Reviewed-on: https://go-review.googlesource.com/c/151400
Reviewed-by: Damien Neil <dneil@google.com>
This commit is contained in:
Joe Tsai 2018-11-27 14:57:21 -08:00 committed by Joe Tsai
parent 411f33952f
commit b6dbf23033
2 changed files with 0 additions and 17 deletions

View File

@ -417,16 +417,6 @@ func genMessage(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, me
// ExtensionRangeArray
if extranges := message.Desc.ExtensionRanges(); extranges.Len() > 0 {
if message.Desc.Options().(*descpb.MessageOptions).GetMessageSetWireFormat() {
g.P("func (m *", message.GoIdent, ") MarshalJSON() ([]byte, error) {")
g.P("return ", protoPackage.Ident("MarshalMessageSetJSON"), "(&m.XXX_InternalExtensions)")
g.P("}")
g.P("func (m *", message.GoIdent, ") UnmarshalJSON(buf []byte) error {")
g.P("return ", protoPackage.Ident("UnmarshalMessageSetJSON"), "(buf, &m.XXX_InternalExtensions)")
g.P("}")
g.P()
}
protoExtRange := protoPackage.Ident("ExtensionRange")
extRangeVar := "extRange_" + message.GoIdent.GoName
g.P("var ", extRangeVar, " = []", protoExtRange, " {")

View File

@ -83,13 +83,6 @@ func (*MessageSetWireFormatMessage) Descriptor() ([]byte, []int) {
return fileDescriptor_aebb28f8d5a04466, []int{1}
}
func (m *MessageSetWireFormatMessage) MarshalJSON() ([]byte, error) {
return proto.MarshalMessageSetJSON(&m.XXX_InternalExtensions)
}
func (m *MessageSetWireFormatMessage) UnmarshalJSON(buf []byte) error {
return proto.UnmarshalMessageSetJSON(buf, &m.XXX_InternalExtensions)
}
var extRange_MessageSetWireFormatMessage = []proto.ExtensionRange{
{Start: 100, End: 2147483646},
}