From 6ceeaab1ba2a72853550b2c5534901e803e1ff3b Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Mon, 8 Jul 2019 12:31:21 -0700 Subject: [PATCH] cmd/protoc-gen-go: remove MessageSet hackery The encoding/prototext and encoding/protojson are implemented entirely in terms of protobuf reflection, which side-steps this information. Remove the hacks in the generator to special-case MessageSet. Change-Id: I708c4636b77672545a103b7ab686f103b9dfc514 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/185240 Reviewed-by: Herbie Ong --- cmd/protoc-gen-go/internal_gengo/main.go | 48 ++----------------- .../testdata/extensions/base/base.pb.go | 4 +- .../testdata/extensions/ext/ext.pb.go | 6 +-- .../testdata/import_public/sub/a.pb.go | 2 +- encoding/testprotos/pb2/test.pb.go | 10 ++-- .../google_message3/benchmark_message3.pb.go | 2 +- .../benchmark_message3_1.pb.go | 4 +- .../benchmark_message3_2.pb.go | 4 +- .../benchmark_message3_4.pb.go | 4 +- .../benchmark_message3_5.pb.go | 16 +++---- .../benchmark_message3_6.pb.go | 2 +- .../google_message4/benchmark_message4.pb.go | 4 +- .../benchmark_message4_1.pb.go | 4 +- .../conformance/test_messages_proto2.pb.go | 8 ++-- internal/testprotos/test/test.pb.go | 2 +- reflect/protoregistry/testprotos/test.pb.go | 2 +- types/descriptorpb/descriptor.pb.go | 18 +++---- 17 files changed, 49 insertions(+), 91 deletions(-) diff --git a/cmd/protoc-gen-go/internal_gengo/main.go b/cmd/protoc-gen-go/internal_gengo/main.go index 22d87ca4..7a2fee0b 100644 --- a/cmd/protoc-gen-go/internal_gengo/main.go +++ b/cmd/protoc-gen-go/internal_gengo/main.go @@ -448,17 +448,11 @@ func genMessage(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, me sf.append("unknownFields") } if message.Desc.ExtensionRanges().Len() > 0 { - // TODO: Remove this tag when we drop v1 support. - var tags []string - if message.Desc.Options().(*descriptorpb.MessageOptions).GetMessageSetWireFormat() { - tags = append(tags, `protobuf_messageset:"1"`) - } if generateExportedExtensionFields { - tags = append(tags, `json:"-"`) - g.P("XXX_InternalExtensions", " ", protoimplPackage.Ident("ExtensionFields"), " `", strings.Join(tags, " "), "`") + g.P("XXX_InternalExtensions", " ", protoimplPackage.Ident("ExtensionFields"), " `json:\"-\"`") sf.append("XXX_InternalExtensions") } else { - g.P("extensionFields", " ", protoimplPackage.Ident("ExtensionFields"), " `", strings.Join(tags, " "), "`") + g.P("extensionFields", " ", protoimplPackage.Ident("ExtensionFields")) sf.append("extensionFields") } } @@ -696,19 +690,6 @@ func genExtensions(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo) g.P("var ", extDescsVarName(f), " = []", protoifacePackage.Ident("ExtensionDescV1"), "{") for _, extension := range f.allExtensions { - // Special case for proto2 message sets: If this extension is extending - // proto2.bridge.MessageSet, and its final name component is "message_set_extension", - // then drop that last component. - // - // TODO: This should be implemented in the text formatter rather than the generator. - // In addition, the situation for when to apply this special case is implemented - // differently in other languages: - // https://github.com/google/protobuf/blob/aff10976/src/google/protobuf/text_format.cc#L1560 - name := extension.Desc.FullName() - if n, ok := isExtensionMessageSetElement(extension); ok { - name = n - } - g.P("{") g.P("ExtendedType: (*", extension.Extendee.GoIdent, ")(nil),") goType, pointer := fieldGoType(g, extension) @@ -717,7 +698,7 @@ func genExtensions(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo) } g.P("ExtensionType: (", goType, ")(nil),") g.P("Field: ", extension.Desc.Number(), ",") - g.P("Name: ", strconv.Quote(string(name)), ",") + g.P("Name: ", strconv.Quote(string(extension.Desc.FullName())), ",") g.P("Tag: ", strconv.Quote(fieldProtobufTag(extension)), ",") g.P("Filename: ", strconv.Quote(f.Desc.Path()), ",") g.P("},") @@ -743,29 +724,6 @@ func genExtensions(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo) g.P(")") } -// isExtensionMessageSetELement returns the adjusted name of an extension -// which extends proto2.bridge.MessageSet. -func isExtensionMessageSetElement(extension *protogen.Extension) (name protoreflect.FullName, ok bool) { - opts := extension.Extendee.Desc.Options().(*descriptorpb.MessageOptions) - if !opts.GetMessageSetWireFormat() || extension.Desc.Name() != "message_set_extension" { - return "", false - } - if extension.Parent == nil { - // This case shouldn't be given special handling at all--we're - // only supposed to drop the ".message_set_extension" for - // extensions defined within a message (i.e., the extension - // takes the message's name). - // - // This matches the behavior of the v1 generator, however. - // - // TODO: See if we can drop this case. - name = extension.Desc.FullName() - name = name[:len(name)-len("message_set_extension")] - return name, true - } - return extension.Desc.FullName().Parent(), true -} - // extensionVar returns the var holding the ExtensionDesc for an extension. func extensionVar(f *protogen.File, extension *protogen.Extension) protogen.GoIdent { name := "E_" 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 3681aac6..dde0588a 100644 --- a/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go +++ b/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go @@ -21,7 +21,7 @@ type BaseMessage struct { Field *string `protobuf:"bytes,1,opt,name=field" json:"field,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *BaseMessage) Reset() { @@ -67,7 +67,7 @@ func (x *BaseMessage) GetField() string { type MessageSetWireFormatMessage struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `protobuf_messageset:"1"` + extensionFields protoimpl.ExtensionFields } func (x *MessageSetWireFormatMessage) Reset() { diff --git a/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go b/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go index 71f3dade..b989089c 100644 --- a/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go +++ b/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go @@ -208,7 +208,7 @@ func (x *RepeatedGroup) GetRepeatedXGroup() []string { type Extendable struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Extendable) Reset() { @@ -653,7 +653,7 @@ var file_extensions_ext_ext_proto_extDescs = []protoiface.ExtensionDescV1{ ExtendedType: (*base.MessageSetWireFormatMessage)(nil), ExtensionType: (*MessageSetWireFormatExtension)(nil), Field: 101, - Name: "goproto.protoc.extension.ext.", + Name: "goproto.protoc.extension.ext.message_set_extension", Tag: "bytes,101,opt,name=message_set_extension", Filename: "extensions/ext/ext.proto", }, @@ -677,7 +677,7 @@ var file_extensions_ext_ext_proto_extDescs = []protoiface.ExtensionDescV1{ ExtendedType: (*base.MessageSetWireFormatMessage)(nil), ExtensionType: (*MessageSetWireFormatExtension)(nil), Field: 100, - Name: "goproto.protoc.extension.ext.MessageSetWireFormatExtension", + Name: "goproto.protoc.extension.ext.MessageSetWireFormatExtension.message_set_extension", Tag: "bytes,100,opt,name=message_set_extension", Filename: "extensions/ext/ext.proto", }, diff --git a/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go b/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go index 5cbcfe94..f4e3a635 100644 --- a/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go +++ b/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go @@ -177,7 +177,7 @@ type M struct { OneofField isM_OneofField `protobuf_oneof:"oneof_field"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *M) Reset() { diff --git a/encoding/testprotos/pb2/test.pb.go b/encoding/testprotos/pb2/test.pb.go index 38670db9..49cf8e8c 100644 --- a/encoding/testprotos/pb2/test.pb.go +++ b/encoding/testprotos/pb2/test.pb.go @@ -791,7 +791,7 @@ type Extensions struct { OptInt32 *int32 `protobuf:"varint,2,opt,name=opt_int32,json=optInt32" json:"opt_int32,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Extensions) Reset() { @@ -878,7 +878,7 @@ func (*ExtensionsContainer) Descriptor() ([]byte, []int) { type MessageSet struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `protobuf_messageset:"1"` + extensionFields protoimpl.ExtensionFields } func (x *MessageSet) Reset() { @@ -952,7 +952,7 @@ func (x *MessageSetExtension) GetOptString() string { type FakeMessageSet struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *FakeMessageSet) Reset() { @@ -1389,7 +1389,7 @@ var file_pb2_test_proto_extDescs = []protoiface.ExtensionDescV1{ ExtendedType: (*MessageSet)(nil), ExtensionType: (*FakeMessageSetExtension)(nil), Field: 50, - Name: "pb2.", + Name: "pb2.message_set_extension", Tag: "bytes,50,opt,name=message_set_extension", Filename: "pb2/test.proto", }, @@ -1461,7 +1461,7 @@ var file_pb2_test_proto_extDescs = []protoiface.ExtensionDescV1{ ExtendedType: (*MessageSet)(nil), ExtensionType: (*MessageSetExtension)(nil), Field: 10, - Name: "pb2.MessageSetExtension", + Name: "pb2.MessageSetExtension.message_set_extension", Tag: "bytes,10,opt,name=message_set_extension", Filename: "pb2/test.proto", }, diff --git a/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3.pb.go b/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3.pb.go index 087607c7..39433b31 100644 --- a/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3.pb.go +++ b/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3.pb.go @@ -1908,7 +1908,7 @@ type Message16507 struct { Field16541 []string `protobuf:"bytes,41,rep,name=field16541" json:"field16541,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message16507) Reset() { diff --git a/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_1.pb.go b/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_1.pb.go index 104c7915..b233fad9 100644 --- a/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_1.pb.go +++ b/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_1.pb.go @@ -2756,7 +2756,7 @@ type Message16727 struct { Field16805 *UnusedEmptyMessage `protobuf:"bytes,25,opt,name=field16805" json:"field16805,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message16727) Reset() { @@ -3409,7 +3409,7 @@ type Message16945 struct { Field17024 []string `protobuf:"bytes,274,rep,name=field17024" json:"field17024,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message16945) Reset() { diff --git a/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_2.pb.go b/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_2.pb.go index 0269ec77..bafecc75 100644 --- a/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_2.pb.go +++ b/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_2.pb.go @@ -1560,7 +1560,7 @@ type Message11874 struct { Field11891 *bool `protobuf:"varint,7,opt,name=field11891" json:"field11891,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message11874) Reset() { @@ -2204,7 +2204,7 @@ type Message18283 struct { Field18581 *bool `protobuf:"varint,193,opt,name=field18581" json:"field18581,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message18283) Reset() { diff --git a/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_4.pb.go b/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_4.pb.go index d9519c51..6a38e88a 100644 --- a/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_4.pb.go +++ b/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_4.pb.go @@ -561,7 +561,7 @@ type Message730 struct { Field929 []byte `protobuf:"bytes,31,opt,name=field929" json:"field929,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message730) Reset() { @@ -1585,7 +1585,7 @@ type Message11873 struct { Field11887 *UnusedEmptyMessage `protobuf:"bytes,15,opt,name=field11887" json:"field11887,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message11873) Reset() { diff --git a/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_5.pb.go b/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_5.pb.go index b813c01f..cc1ddc46 100644 --- a/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_5.pb.go +++ b/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_5.pb.go @@ -269,7 +269,7 @@ type Message728 struct { Field895 []string `protobuf:"bytes,9,rep,name=field895" json:"field895,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message728) Reset() { @@ -492,7 +492,7 @@ type Message697 struct { Field778 *int64 `protobuf:"varint,38,opt,name=field778" json:"field778,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message697) Reset() { @@ -783,7 +783,7 @@ func (x *Message697) GetField778() int64 { type Message0 struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `protobuf_messageset:"1"` + extensionFields protoimpl.ExtensionFields } func (x *Message0) Reset() { @@ -1007,7 +1007,7 @@ type Message10573 struct { Field10581 *string `protobuf:"bytes,2,opt,name=field10581" json:"field10581,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message10573) Reset() { @@ -1249,7 +1249,7 @@ type Message10155 struct { Field10264 []*Message9628 `protobuf:"bytes,94,rep,name=field10264" json:"field10264,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message10155) Reset() { @@ -2205,7 +2205,7 @@ type Message13145 struct { Field13157 *float32 `protobuf:"fixed32,3,opt,name=field13157" json:"field13157,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message13145) Reset() { @@ -2503,7 +2503,7 @@ type Message8301 struct { Field8338 *Message7965 `protobuf:"bytes,11,opt,name=field8338" json:"field8338,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message8301) Reset() { @@ -2667,7 +2667,7 @@ type Message8302 struct { Field8359 *Message7965 `protobuf:"bytes,21,opt,name=field8359" json:"field8359,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message8302) Reset() { diff --git a/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_6.pb.go b/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_6.pb.go index 3ed17a1a..80fd1844 100644 --- a/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_6.pb.go +++ b/internal/testprotos/benchmarks/datasets/google_message3/benchmark_message3_6.pb.go @@ -642,7 +642,7 @@ type Message9182 struct { Field9230 *float32 `protobuf:"fixed32,39,opt,name=field9230" json:"field9230,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message9182) Reset() { diff --git a/internal/testprotos/benchmarks/datasets/google_message4/benchmark_message4.pb.go b/internal/testprotos/benchmarks/datasets/google_message4/benchmark_message4.pb.go index 3027d947..9994dbd0 100644 --- a/internal/testprotos/benchmarks/datasets/google_message4/benchmark_message4.pb.go +++ b/internal/testprotos/benchmarks/datasets/google_message4/benchmark_message4.pb.go @@ -2259,7 +2259,7 @@ type Message3069 struct { Message3070 []*Message3069_Message3070 `protobuf:"group,3,rep,name=Message3070,json=message3070" json:"message3070,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message3069) Reset() { @@ -3486,7 +3486,7 @@ func (x *Message2356) GetField2398() string { type Message0 struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `protobuf_messageset:"1"` + extensionFields protoimpl.ExtensionFields } func (x *Message0) Reset() { diff --git a/internal/testprotos/benchmarks/datasets/google_message4/benchmark_message4_1.pb.go b/internal/testprotos/benchmarks/datasets/google_message4/benchmark_message4_1.pb.go index 5a470828..9bfa0b1b 100644 --- a/internal/testprotos/benchmarks/datasets/google_message4/benchmark_message4_1.pb.go +++ b/internal/testprotos/benchmarks/datasets/google_message4/benchmark_message4_1.pb.go @@ -1274,7 +1274,7 @@ type Message12776 struct { Field12795 *UnusedEmptyMessage `protobuf:"bytes,12,opt,name=field12795" json:"field12795,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message12776) Reset() { @@ -2363,7 +2363,7 @@ type Message6109 struct { Field6151 *bool `protobuf:"varint,14,opt,name=field6151" json:"field6151,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message6109) Reset() { diff --git a/internal/testprotos/conformance/test_messages_proto2.pb.go b/internal/testprotos/conformance/test_messages_proto2.pb.go index 28b80584..39ef2914 100644 --- a/internal/testprotos/conformance/test_messages_proto2.pb.go +++ b/internal/testprotos/conformance/test_messages_proto2.pb.go @@ -234,7 +234,7 @@ type TestAllTypesProto2 struct { FieldName18__ *int32 `protobuf:"varint,418,opt,name=Field_name18__,json=FieldName18" json:"Field_name18__,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *TestAllTypesProto2) Reset() { @@ -1093,7 +1093,7 @@ func (x *TestAllTypesProto2_Data) GetGroupUint32() uint32 { type TestAllTypesProto2_MessageSetCorrect struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `protobuf_messageset:"1"` + extensionFields protoimpl.ExtensionFields } func (x *TestAllTypesProto2_MessageSetCorrect) Reset() { @@ -1213,7 +1213,7 @@ var file_google_protobuf_test_messages_proto2_proto_extDescs = []protoiface.Exte ExtendedType: (*TestAllTypesProto2_MessageSetCorrect)(nil), ExtensionType: (*TestAllTypesProto2_MessageSetCorrectExtension1)(nil), Field: 1547769, - Name: "protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension1", + Name: "protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension1.message_set_extension", Tag: "bytes,1547769,opt,name=message_set_extension", Filename: "google/protobuf/test_messages_proto2.proto", }, @@ -1221,7 +1221,7 @@ var file_google_protobuf_test_messages_proto2_proto_extDescs = []protoiface.Exte ExtendedType: (*TestAllTypesProto2_MessageSetCorrect)(nil), ExtensionType: (*TestAllTypesProto2_MessageSetCorrectExtension2)(nil), Field: 4135312, - Name: "protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension2", + Name: "protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension2.message_set_extension", Tag: "bytes,4135312,opt,name=message_set_extension", Filename: "google/protobuf/test_messages_proto2.proto", }, diff --git a/internal/testprotos/test/test.pb.go b/internal/testprotos/test/test.pb.go index e044c537..bae3e177 100644 --- a/internal/testprotos/test/test.pb.go +++ b/internal/testprotos/test/test.pb.go @@ -1174,7 +1174,7 @@ func (*TestReservedFields) Descriptor() ([]byte, []int) { type TestAllExtensions struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *TestAllExtensions) Reset() { diff --git a/reflect/protoregistry/testprotos/test.pb.go b/reflect/protoregistry/testprotos/test.pb.go index d79e2d64..945d1a46 100644 --- a/reflect/protoregistry/testprotos/test.pb.go +++ b/reflect/protoregistry/testprotos/test.pb.go @@ -162,7 +162,7 @@ func (Enum3) EnumDescriptor() ([]byte, []int) { type Message1 struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *Message1) Reset() { diff --git a/types/descriptorpb/descriptor.pb.go b/types/descriptorpb/descriptor.pb.go index decbb17e..e27b44ee 100644 --- a/types/descriptorpb/descriptor.pb.go +++ b/types/descriptorpb/descriptor.pb.go @@ -692,7 +692,7 @@ type ExtensionRangeOptions struct { UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *ExtensionRangeOptions) Reset() { @@ -1259,7 +1259,7 @@ type FileOptions struct { UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *FileOptions) Reset() { @@ -1507,7 +1507,7 @@ type MessageOptions struct { UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *MessageOptions) Reset() { @@ -1645,7 +1645,7 @@ type FieldOptions struct { UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *FieldOptions) Reset() { @@ -1740,7 +1740,7 @@ type OneofOptions struct { UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *OneofOptions) Reset() { @@ -1795,7 +1795,7 @@ type EnumOptions struct { UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *EnumOptions) Reset() { @@ -1863,7 +1863,7 @@ type EnumValueOptions struct { UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *EnumValueOptions) Reset() { @@ -1924,7 +1924,7 @@ type ServiceOptions struct { UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *ServiceOptions) Reset() { @@ -1986,7 +1986,7 @@ type MethodOptions struct { UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - extensionFields protoimpl.ExtensionFields `` + extensionFields protoimpl.ExtensionFields } func (x *MethodOptions) Reset() {