diff --git a/cmd/protoc-gen-go/internal_gengo/main.go b/cmd/protoc-gen-go/internal_gengo/main.go index 6fd1fca8..3778a245 100644 --- a/cmd/protoc-gen-go/internal_gengo/main.go +++ b/cmd/protoc-gen-go/internal_gengo/main.go @@ -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, " {") diff --git a/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go b/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go index 76f04e0b..fd147a3c 100644 --- a/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go +++ b/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go @@ -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}, }