Просмотр исходного кода

cmd/protoc-gen-go: perform some code cleanup

Minor changes:
* Use x as the receiver since "e" and "m" are meaningless in the presence
of user-defined enum and message names.
* Consistently keep enum methods together, rather awkwardly split apart
by the value maps.

Change-Id: I68e5666efb56ac7a4d062fb223b9f826dc72aba9
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/170357
Reviewed-by: Herbie Ong <herbie@google.com>
Joe Tsai 6 лет назад
Родитель
Сommit
61968ce130
59 измененных файлов с 3786 добавлено и 2792 удалено
  1. 24 10
      cmd/protoc-gen-go-grpc/testdata/grpc/grpc.pb.go
  2. 1 1
      cmd/protoc-gen-go/annotation_test.go
  3. 39 22
      cmd/protoc-gen-go/internal_gengo/main.go
  4. 14 5
      cmd/protoc-gen-go/internal_gengo/reflect.go
  5. 23 15
      cmd/protoc-gen-go/testdata/annotations/annotations.pb.go
  6. 1 1
      cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta
  7. 77 35
      cmd/protoc-gen-go/testdata/comments/comments.pb.go
  8. 23 15
      cmd/protoc-gen-go/testdata/comments/deprecated.pb.go
  9. 27 13
      cmd/protoc-gen-go/testdata/extensions/base/base.pb.go
  10. 111 58
      cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go
  11. 15 8
      cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go
  12. 20 12
      cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go
  13. 74 60
      cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go
  14. 21 14
      cmd/protoc-gen-go/testdata/import_public/a.pb.go
  15. 18 11
      cmd/protoc-gen-go/testdata/import_public/b.pb.go
  16. 68 51
      cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
  17. 12 5
      cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go
  18. 12 5
      cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go
  19. 12 5
      cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go
  20. 35 20
      cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
  21. 12 5
      cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go
  22. 12 5
      cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go
  23. 12 5
      cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go
  24. 12 5
      cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go
  25. 12 5
      cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go
  26. 15 8
      cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go
  27. 15 8
      cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go
  28. 27 20
      cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go
  29. 14 7
      cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go
  30. 26 18
      cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go
  31. 76 60
      cmd/protoc-gen-go/testdata/proto2/enum.pb.go
  32. 301 293
      cmd/protoc-gen-go/testdata/proto2/fields.pb.go
  33. 45 24
      cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go
  34. 18 11
      cmd/protoc-gen-go/testdata/proto2/proto2.pb.go
  35. 8 7
      cmd/protoc-gen-go/testdata/proto3/enum.pb.go
  36. 143 128
      cmd/protoc-gen-go/testdata/proto3/fields.pb.go
  37. 414 300
      encoding/testprotos/pb2/test.pb.go
  38. 184 133
      encoding/testprotos/pb3/test.pb.go
  39. 106 76
      internal/testprotos/conformance/conformance.pb.go
  40. 48 41
      internal/testprotos/legacy/legacy.pb.go
  41. 296 285
      internal/testprotos/test/test.pb.go
  42. 20 12
      internal/testprotos/test/test_import.pb.go
  43. 12 5
      internal/testprotos/test/test_public.pb.go
  44. 12 5
      internal/testprotos/test/test_weak.pb.go
  45. 259 236
      internal/testprotos/test3/test.pb.go
  46. 20 12
      internal/testprotos/test3/test_import.pb.go
  47. 75 44
      reflect/protoregistry/testprotos/test.pb.go
  48. 339 256
      types/descriptor/descriptor.pb.go
  49. 18 11
      types/known/any.pb.go
  50. 84 63
      types/known/api.pb.go
  51. 18 11
      types/known/duration.pb.go
  52. 12 5
      types/known/empty.pb.go
  53. 15 8
      types/known/field_mask.pb.go
  54. 15 8
      types/known/source_context.pb.go
  55. 62 40
      types/known/struct.pb.go
  56. 18 11
      types/known/timestamp.pb.go
  57. 162 124
      types/known/type.pb.go
  58. 135 72
      types/known/wrappers.pb.go
  59. 87 59
      types/plugin/plugin.pb.go

+ 24 - 10
cmd/protoc-gen-go-grpc/testdata/grpc/grpc.pb.go

@@ -18,12 +18,19 @@ type Request struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Request) ProtoReflect() protoreflect.Message {
-	return xxx_File_grpc_grpc_proto_messageTypes[0].MessageOf(m)
+func (x *Request) Reset() {
+	*x = Request{}
+}
+
+func (x *Request) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Request) ProtoMessage() {}
+
+func (x *Request) ProtoReflect() protoreflect.Message {
+	return xxx_File_grpc_grpc_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Request) Reset()         { *m = Request{} }
-func (m *Request) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Request) ProtoMessage()    {}
 
 // Deprecated: Use Request.ProtoReflect.Type instead.
 func (*Request) Descriptor() ([]byte, []int) {
@@ -36,12 +43,19 @@ type Response struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Response) ProtoReflect() protoreflect.Message {
-	return xxx_File_grpc_grpc_proto_messageTypes[1].MessageOf(m)
+func (x *Response) Reset() {
+	*x = Response{}
+}
+
+func (x *Response) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Response) ProtoMessage() {}
+
+func (x *Response) ProtoReflect() protoreflect.Message {
+	return xxx_File_grpc_grpc_proto_messageTypes[1].MessageOf(x)
 }
-func (m *Response) Reset()         { *m = Response{} }
-func (m *Response) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Response) ProtoMessage()    {}
 
 // Deprecated: Use Response.ProtoReflect.Type instead.
 func (*Response) Descriptor() ([]byte, []int) {

+ 1 - 1
cmd/protoc-gen-go/annotation_test.go

@@ -47,7 +47,7 @@ func TestAnnotations(t *testing.T) {
 		"\t", "AnnotationsTestField", " ",
 		[]int32{fieldnum.FileDescriptorProto_MessageType, 0, fieldnum.DescriptorProto_Field, 0},
 	}, {
-		"func (m *AnnotationsTestMessage) ", "GetAnnotationsTestField", "() string {",
+		"func (x *AnnotationsTestMessage) ", "GetAnnotationsTestField", "() string {",
 		[]int32{fieldnum.FileDescriptorProto_MessageType, 0, fieldnum.DescriptorProto_Field, 0},
 	}} {
 		s := want.prefix + want.text + want.suffix

+ 39 - 22
cmd/protoc-gen-go/internal_gengo/main.go

@@ -207,10 +207,13 @@ func genImport(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, imp
 }
 
 func genEnum(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, enum *protogen.Enum) {
+	// Enum type declaration.
 	g.PrintLeadingComments(enum.Location)
 	g.Annotate(enum.GoIdent.GoName, enum.Location)
 	g.P("type ", enum.GoIdent, " int32",
 		deprecationComment(enum.Desc.Options().(*descriptorpb.EnumOptions).GetDeprecated()))
+
+	// Enum value constants.
 	g.P("const (")
 	for _, value := range enum.Values {
 		g.PrintLeadingComments(value.Location)
@@ -221,9 +224,7 @@ func genEnum(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, enum
 	g.P(")")
 	g.P()
 
-	// Generate support for protobuf reflection.
-	genReflectEnum(gen, g, f, enum)
-
+	// Enum value mapping (number -> name).
 	nameMap := enum.GoIdent.GoName + "_name"
 	g.P("// Deprecated: Use ", enum.GoIdent.GoName, ".Type.Values instead.")
 	g.P("var ", nameMap, " = map[int32]string{")
@@ -239,6 +240,7 @@ func genEnum(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, enum
 	g.P("}")
 	g.P()
 
+	// Enum value mapping (name -> number).
 	valueMap := enum.GoIdent.GoName + "_value"
 	g.P("// Deprecated: Use ", enum.GoIdent.GoName, ".Type.Values instead.")
 	g.P("var ", valueMap, " = map[string]int32{")
@@ -248,17 +250,22 @@ func genEnum(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, enum
 	g.P("}")
 	g.P()
 
+	// Enum method.
 	if enum.Desc.Syntax() != protoreflect.Proto3 {
 		g.P("func (x ", enum.GoIdent, ") Enum() *", enum.GoIdent, " {")
 		g.P("return &x")
 		g.P("}")
 		g.P()
 	}
+	// String method.
 	g.P("func (x ", enum.GoIdent, ") String() string {")
 	g.P("return ", protoimplPackage.Ident("X"), ".EnumStringOf(x.Type(), ", protoreflectPackage.Ident("EnumNumber"), "(x))")
 	g.P("}")
 	g.P()
 
+	genReflectEnum(gen, g, f, enum)
+
+	// UnmarshalJSON method.
 	if enum.Desc.Syntax() == protoreflect.Proto2 {
 		g.P("// Deprecated: Do not use.")
 		g.P("func (x *", enum.GoIdent, ") UnmarshalJSON(b []byte) error {")
@@ -272,6 +279,7 @@ func genEnum(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, enum
 		g.P()
 	}
 
+	// EnumDescriptor method.
 	var indexes []string
 	for i := 1; i < len(enum.Location.Path); i += 2 {
 		indexes = append(indexes, strconv.Itoa(int(enum.Location.Path[i])))
@@ -285,13 +293,12 @@ func genEnum(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, enum
 	genWellKnownType(g, "", enum.GoIdent, enum.Desc)
 }
 
-// enumRegistryName returns the name used to register an enum with the proto
-// package registry.
+// enumLegacyName returns the name used by the v1 proto package.
 //
 // Confusingly, this is <proto_package>.<go_ident>. This probably should have
 // been the full name of the proto enum type instead, but changing it at this
 // point would require thought.
-func enumRegistryName(enum *protogen.Enum) string {
+func enumLegacyName(enum *protogen.Enum) string {
 	// Find the FileDescriptor for this enum.
 	var desc protoreflect.Descriptor = enum.Desc
 	for {
@@ -313,6 +320,7 @@ func genMessage(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, me
 		return
 	}
 
+	// Message type declaration.
 	hasComment := g.PrintLeadingComments(message.Location)
 	if message.Desc.Options().(*descriptorpb.MessageOptions).GetDeprecated() {
 		if hasComment {
@@ -369,16 +377,23 @@ func genMessage(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, me
 	g.P("}")
 	g.P()
 
-	// Generate support for protobuf reflection.
+	// Reset method.
+	g.P("func (x *", message.GoIdent, ") Reset() {")
+	g.P("*x = ", message.GoIdent, "{}")
+	g.P("}")
+	g.P()
+	// String method.
+	g.P("func (x *", message.GoIdent, ") String() string {")
+	g.P("return ", protoimplPackage.Ident("X"), ".MessageStringOf(x)")
+	g.P("}")
+	g.P()
+	// ProtoMessage method.
+	g.P("func (*", message.GoIdent, ") ProtoMessage() {}")
+	g.P()
+
 	genReflectMessage(gen, g, f, message)
 
-	// Reset
-	g.P("func (m *", message.GoIdent, ") Reset() { *m = ", message.GoIdent, "{} }")
-	// String
-	g.P("func (m *", message.GoIdent, ") String() string { return ", protoimplPackage.Ident("X"), ".MessageStringOf(m) }")
-	// ProtoMessage
-	g.P("func (*", message.GoIdent, ") ProtoMessage() {}")
-	// Descriptor
+	// Descriptor method.
 	var indexes []string
 	for i := 1; i < len(message.Location.Path); i += 2 {
 		indexes = append(indexes, strconv.Itoa(int(message.Location.Path[i])))
@@ -389,7 +404,7 @@ func genMessage(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, me
 	g.P("}")
 	g.P()
 
-	// ExtensionRangeArray
+	// ExtensionRangeArray method.
 	if extranges := message.Desc.ExtensionRanges(); extranges.Len() > 0 {
 		protoExtRange := protoifacePackage.Ident("ExtensionRangeV1")
 		extRangeVar := "extRange_" + message.GoIdent.GoName
@@ -459,7 +474,7 @@ func genMessage(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, me
 	}
 	g.P()
 
-	// Getters.
+	// Getter methods.
 	for _, field := range message.Fields {
 		if field.OneofType != nil {
 			if field == field.OneofType.Fields[0] {
@@ -472,22 +487,22 @@ func genMessage(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, me
 			g.P(deprecationComment(true))
 		}
 		g.Annotate(message.GoIdent.GoName+".Get"+field.GoName, field.Location)
-		g.P("func (m *", message.GoIdent, ") Get", field.GoName, "() ", goType, " {")
+		g.P("func (x *", message.GoIdent, ") Get", field.GoName, "() ", goType, " {")
 		if field.OneofType != nil {
-			g.P("if x, ok := m.Get", field.OneofType.GoName, "().(*", fieldOneofType(field), "); ok {")
+			g.P("if x, ok := x.Get", field.OneofType.GoName, "().(*", fieldOneofType(field), "); ok {")
 			g.P("return x.", field.GoName)
 			g.P("}")
 		} else {
 			if field.Desc.Syntax() == protoreflect.Proto3 || defaultValue == "nil" {
-				g.P("if m != nil {")
+				g.P("if x != nil {")
 			} else {
-				g.P("if m != nil && m.", field.GoName, " != nil {")
+				g.P("if x != nil && x.", field.GoName, " != nil {")
 			}
 			star := ""
 			if pointer {
 				star = "*"
 			}
-			g.P("return ", star, " m.", field.GoName)
+			g.P("return ", star, " x.", field.GoName)
 			g.P("}")
 		}
 		g.P("return ", defaultValue)
@@ -550,7 +565,7 @@ func fieldGoType(g *protogen.GeneratedFile, field *protogen.Field) (goType strin
 func fieldProtobufTag(field *protogen.Field) string {
 	var enumName string
 	if field.Desc.Kind() == protoreflect.EnumKind {
-		enumName = enumRegistryName(field.EnumType)
+		enumName = enumLegacyName(field.EnumType)
 	}
 	return tag.Marshal(field.Desc, enumName)
 }
@@ -679,6 +694,8 @@ func deprecationComment(deprecated bool) string {
 	return "// Deprecated: Do not use."
 }
 
+// TODO: Remove this. This was added to aid jsonpb, but jsonpb does this work
+// through the use of protobuf reflection now.
 func genWellKnownType(g *protogen.GeneratedFile, ptr string, ident protogen.GoIdent, desc protoreflect.Descriptor) {
 	if wellKnownTypes[desc.FullName()] {
 		g.P("func (", ptr, ident, `) XXX_WellKnownType() string { return "`, desc.Name(), `" }`)

+ 14 - 5
cmd/protoc-gen-go/internal_gengo/reflect.go

@@ -242,20 +242,29 @@ func genFileDescriptor(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileI
 func genReflectEnum(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, enum *protogen.Enum) {
 	idx := f.allEnumsByPtr[enum]
 	typesVar := enumTypesVarName(f)
-	g.P("func (e ", enum.GoIdent, ") Type() ", protoreflectPackage.Ident("EnumType"), " {")
+
+	// Type method.
+	g.P("func (", enum.GoIdent, ") Type() ", protoreflectPackage.Ident("EnumType"), " {")
 	g.P("return ", typesVar, "[", idx, "]")
 	g.P("}")
-	g.P("func (e ", enum.GoIdent, ") Number() ", protoreflectPackage.Ident("EnumNumber"), " {")
-	g.P("return ", protoreflectPackage.Ident("EnumNumber"), "(e)")
+	g.P()
+
+	// Number method.
+	g.P("func (x ", enum.GoIdent, ") Number() ", protoreflectPackage.Ident("EnumNumber"), " {")
+	g.P("return ", protoreflectPackage.Ident("EnumNumber"), "(x)")
 	g.P("}")
+	g.P()
 }
 
 func genReflectMessage(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, message *protogen.Message) {
 	idx := f.allMessagesByPtr[message]
 	typesVar := messageTypesVarName(f)
-	g.P("func (m *", message.GoIdent, ") ProtoReflect() ", protoreflectPackage.Ident("Message"), " {")
-	g.P("return ", typesVar, "[", idx, "].MessageOf(m)")
+
+	// ProtoReflect method.
+	g.P("func (x *", message.GoIdent, ") ProtoReflect() ", protoreflectPackage.Ident("Message"), " {")
+	g.P("return ", typesVar, "[", idx, "].MessageOf(x)")
 	g.P("}")
+	g.P()
 }
 
 func rawDescVarName(f *fileInfo) string {

+ 23 - 15
cmd/protoc-gen-go/testdata/annotations/annotations.pb.go

@@ -18,13 +18,6 @@ const (
 	AnnotationsTestEnum_ANNOTATIONS_TEST_ENUM_VALUE AnnotationsTestEnum = 0
 )
 
-func (e AnnotationsTestEnum) Type() protoreflect.EnumType {
-	return xxx_File_annotations_annotations_proto_enumTypes[0]
-}
-func (e AnnotationsTestEnum) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use AnnotationsTestEnum.Type.Values instead.
 var AnnotationsTestEnum_name = map[int32]string{
 	0: "ANNOTATIONS_TEST_ENUM_VALUE",
@@ -43,6 +36,14 @@ func (x AnnotationsTestEnum) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (AnnotationsTestEnum) Type() protoreflect.EnumType {
+	return xxx_File_annotations_annotations_proto_enumTypes[0]
+}
+
+func (x AnnotationsTestEnum) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Do not use.
 func (x *AnnotationsTestEnum) UnmarshalJSON(b []byte) error {
 	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
@@ -65,21 +66,28 @@ type AnnotationsTestMessage struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *AnnotationsTestMessage) ProtoReflect() protoreflect.Message {
-	return xxx_File_annotations_annotations_proto_messageTypes[0].MessageOf(m)
+func (x *AnnotationsTestMessage) Reset() {
+	*x = AnnotationsTestMessage{}
+}
+
+func (x *AnnotationsTestMessage) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*AnnotationsTestMessage) ProtoMessage() {}
+
+func (x *AnnotationsTestMessage) ProtoReflect() protoreflect.Message {
+	return xxx_File_annotations_annotations_proto_messageTypes[0].MessageOf(x)
 }
-func (m *AnnotationsTestMessage) Reset()         { *m = AnnotationsTestMessage{} }
-func (m *AnnotationsTestMessage) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*AnnotationsTestMessage) ProtoMessage()    {}
 
 // Deprecated: Use AnnotationsTestMessage.ProtoReflect.Type instead.
 func (*AnnotationsTestMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_annotations_annotations_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *AnnotationsTestMessage) GetAnnotationsTestField() string {
-	if m != nil && m.AnnotationsTestField != nil {
-		return *m.AnnotationsTestField
+func (x *AnnotationsTestMessage) GetAnnotationsTestField() string {
+	if x != nil && x.AnnotationsTestField != nil {
+		return *x.AnnotationsTestField
 	}
 	return ""
 }

+ 1 - 1
cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta

@@ -1 +1 @@
-annotation:{path:5 path:0 source_file:"annotations/annotations.proto" begin:398 end:417} annotation:{path:5 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:434 end:481} annotation:{path:4 path:0 source_file:"annotations/annotations.proto" begin:1640 end:1662} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:1673 end:1693} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:2535 end:2558}
+annotation:{path:5 path:0 source_file:"annotations/annotations.proto" begin:398 end:417} annotation:{path:5 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:434 end:481} annotation:{path:4 path:0 source_file:"annotations/annotations.proto" begin:1639 end:1661} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:1672 end:1692} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:2528 end:2551}

+ 77 - 35
cmd/protoc-gen-go/testdata/comments/comments.pb.go

@@ -29,21 +29,28 @@ type Message1 struct {
 	XXX_sizecache        int32              `json:"-"`
 }
 
-func (m *Message1) ProtoReflect() protoreflect.Message {
-	return xxx_File_comments_comments_proto_messageTypes[0].MessageOf(m)
+func (x *Message1) Reset() {
+	*x = Message1{}
+}
+
+func (x *Message1) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message1) ProtoMessage() {}
+
+func (x *Message1) ProtoReflect() protoreflect.Message {
+	return xxx_File_comments_comments_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Message1) Reset()         { *m = Message1{} }
-func (m *Message1) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message1) ProtoMessage()    {}
 
 // Deprecated: Use Message1.ProtoReflect.Type instead.
 func (*Message1) Descriptor() ([]byte, []int) {
 	return xxx_File_comments_comments_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *Message1) GetField1A() string {
-	if m != nil && m.Field1A != nil {
-		return *m.Field1A
+func (x *Message1) GetField1A() string {
+	if x != nil && x.Field1A != nil {
+		return *x.Field1A
 	}
 	return ""
 }
@@ -65,8 +72,8 @@ func (m *Message1) GetOneof1A() isMessage1_Oneof1A {
 	return nil
 }
 
-func (m *Message1) GetOneof1AField1() string {
-	if x, ok := m.GetOneof1A().(*Message1_Oneof1AField1); ok {
+func (x *Message1) GetOneof1AField1() string {
+	if x, ok := x.GetOneof1A().(*Message1_Oneof1AField1); ok {
 		return x.Oneof1AField1
 	}
 	return ""
@@ -86,12 +93,19 @@ type Message2 struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Message2) ProtoReflect() protoreflect.Message {
-	return xxx_File_comments_comments_proto_messageTypes[1].MessageOf(m)
+func (x *Message2) Reset() {
+	*x = Message2{}
+}
+
+func (x *Message2) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message2) ProtoMessage() {}
+
+func (x *Message2) ProtoReflect() protoreflect.Message {
+	return xxx_File_comments_comments_proto_messageTypes[1].MessageOf(x)
 }
-func (m *Message2) Reset()         { *m = Message2{} }
-func (m *Message2) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message2) ProtoMessage()    {}
 
 // Deprecated: Use Message2.ProtoReflect.Type instead.
 func (*Message2) Descriptor() ([]byte, []int) {
@@ -105,12 +119,19 @@ type Message1_Message1A struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Message1_Message1A) ProtoReflect() protoreflect.Message {
-	return xxx_File_comments_comments_proto_messageTypes[2].MessageOf(m)
+func (x *Message1_Message1A) Reset() {
+	*x = Message1_Message1A{}
+}
+
+func (x *Message1_Message1A) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message1_Message1A) ProtoMessage() {}
+
+func (x *Message1_Message1A) ProtoReflect() protoreflect.Message {
+	return xxx_File_comments_comments_proto_messageTypes[2].MessageOf(x)
 }
-func (m *Message1_Message1A) Reset()         { *m = Message1_Message1A{} }
-func (m *Message1_Message1A) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message1_Message1A) ProtoMessage()    {}
 
 // Deprecated: Use Message1_Message1A.ProtoReflect.Type instead.
 func (*Message1_Message1A) Descriptor() ([]byte, []int) {
@@ -124,12 +145,19 @@ type Message1_Message1B struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Message1_Message1B) ProtoReflect() protoreflect.Message {
-	return xxx_File_comments_comments_proto_messageTypes[3].MessageOf(m)
+func (x *Message1_Message1B) Reset() {
+	*x = Message1_Message1B{}
+}
+
+func (x *Message1_Message1B) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message1_Message1B) ProtoMessage() {}
+
+func (x *Message1_Message1B) ProtoReflect() protoreflect.Message {
+	return xxx_File_comments_comments_proto_messageTypes[3].MessageOf(x)
 }
-func (m *Message1_Message1B) Reset()         { *m = Message1_Message1B{} }
-func (m *Message1_Message1B) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message1_Message1B) ProtoMessage()    {}
 
 // Deprecated: Use Message1_Message1B.ProtoReflect.Type instead.
 func (*Message1_Message1B) Descriptor() ([]byte, []int) {
@@ -143,12 +171,19 @@ type Message2_Message2A struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Message2_Message2A) ProtoReflect() protoreflect.Message {
-	return xxx_File_comments_comments_proto_messageTypes[4].MessageOf(m)
+func (x *Message2_Message2A) Reset() {
+	*x = Message2_Message2A{}
+}
+
+func (x *Message2_Message2A) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message2_Message2A) ProtoMessage() {}
+
+func (x *Message2_Message2A) ProtoReflect() protoreflect.Message {
+	return xxx_File_comments_comments_proto_messageTypes[4].MessageOf(x)
 }
-func (m *Message2_Message2A) Reset()         { *m = Message2_Message2A{} }
-func (m *Message2_Message2A) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message2_Message2A) ProtoMessage()    {}
 
 // Deprecated: Use Message2_Message2A.ProtoReflect.Type instead.
 func (*Message2_Message2A) Descriptor() ([]byte, []int) {
@@ -162,12 +197,19 @@ type Message2_Message2B struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Message2_Message2B) ProtoReflect() protoreflect.Message {
-	return xxx_File_comments_comments_proto_messageTypes[5].MessageOf(m)
+func (x *Message2_Message2B) Reset() {
+	*x = Message2_Message2B{}
+}
+
+func (x *Message2_Message2B) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message2_Message2B) ProtoMessage() {}
+
+func (x *Message2_Message2B) ProtoReflect() protoreflect.Message {
+	return xxx_File_comments_comments_proto_messageTypes[5].MessageOf(x)
 }
-func (m *Message2_Message2B) Reset()         { *m = Message2_Message2B{} }
-func (m *Message2_Message2B) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message2_Message2B) ProtoMessage()    {}
 
 // Deprecated: Use Message2_Message2B.ProtoReflect.Type instead.
 func (*Message2_Message2B) Descriptor() ([]byte, []int) {

+ 23 - 15
cmd/protoc-gen-go/testdata/comments/deprecated.pb.go

@@ -17,13 +17,6 @@ const (
 	DeprecatedEnum_DEPRECATED DeprecatedEnum = 0 // Deprecated: Do not use.
 )
 
-func (e DeprecatedEnum) Type() protoreflect.EnumType {
-	return xxx_File_comments_deprecated_proto_enumTypes[0]
-}
-func (e DeprecatedEnum) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use DeprecatedEnum.Type.Values instead.
 var DeprecatedEnum_name = map[int32]string{
 	0: "DEPRECATED",
@@ -38,6 +31,14 @@ func (x DeprecatedEnum) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (DeprecatedEnum) Type() protoreflect.EnumType {
+	return xxx_File_comments_deprecated_proto_enumTypes[0]
+}
+
+func (x DeprecatedEnum) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Use DeprecatedEnum.Type instead.
 func (DeprecatedEnum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_comments_deprecated_proto_rawDescGZIP(), []int{0}
@@ -51,12 +52,19 @@ type DeprecatedMessage struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *DeprecatedMessage) ProtoReflect() protoreflect.Message {
-	return xxx_File_comments_deprecated_proto_messageTypes[0].MessageOf(m)
+func (x *DeprecatedMessage) Reset() {
+	*x = DeprecatedMessage{}
+}
+
+func (x *DeprecatedMessage) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DeprecatedMessage) ProtoMessage() {}
+
+func (x *DeprecatedMessage) ProtoReflect() protoreflect.Message {
+	return xxx_File_comments_deprecated_proto_messageTypes[0].MessageOf(x)
 }
-func (m *DeprecatedMessage) Reset()         { *m = DeprecatedMessage{} }
-func (m *DeprecatedMessage) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*DeprecatedMessage) ProtoMessage()    {}
 
 // Deprecated: Use DeprecatedMessage.ProtoReflect.Type instead.
 func (*DeprecatedMessage) Descriptor() ([]byte, []int) {
@@ -64,9 +72,9 @@ func (*DeprecatedMessage) Descriptor() ([]byte, []int) {
 }
 
 // Deprecated: Do not use.
-func (m *DeprecatedMessage) GetDeprecatedField() string {
-	if m != nil {
-		return m.DeprecatedField
+func (x *DeprecatedMessage) GetDeprecatedField() string {
+	if x != nil {
+		return x.DeprecatedField
 	}
 	return ""
 }

+ 27 - 13
cmd/protoc-gen-go/testdata/extensions/base/base.pb.go

@@ -21,12 +21,19 @@ type BaseMessage struct {
 	XXX_sizecache          int32                       `json:"-"`
 }
 
-func (m *BaseMessage) ProtoReflect() protoreflect.Message {
-	return xxx_File_extensions_base_base_proto_messageTypes[0].MessageOf(m)
+func (x *BaseMessage) Reset() {
+	*x = BaseMessage{}
+}
+
+func (x *BaseMessage) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BaseMessage) ProtoMessage() {}
+
+func (x *BaseMessage) ProtoReflect() protoreflect.Message {
+	return xxx_File_extensions_base_base_proto_messageTypes[0].MessageOf(x)
 }
-func (m *BaseMessage) Reset()         { *m = BaseMessage{} }
-func (m *BaseMessage) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*BaseMessage) ProtoMessage()    {}
 
 // Deprecated: Use BaseMessage.ProtoReflect.Type instead.
 func (*BaseMessage) Descriptor() ([]byte, []int) {
@@ -43,9 +50,9 @@ func (*BaseMessage) ExtensionRangeArray() []protoiface.ExtensionRangeV1 {
 	return extRange_BaseMessage
 }
 
-func (m *BaseMessage) GetField() string {
-	if m != nil && m.Field != nil {
-		return *m.Field
+func (x *BaseMessage) GetField() string {
+	if x != nil && x.Field != nil {
+		return *x.Field
 	}
 	return ""
 }
@@ -57,12 +64,19 @@ type MessageSetWireFormatMessage struct {
 	XXX_sizecache          int32                       `json:"-"`
 }
 
-func (m *MessageSetWireFormatMessage) ProtoReflect() protoreflect.Message {
-	return xxx_File_extensions_base_base_proto_messageTypes[1].MessageOf(m)
+func (x *MessageSetWireFormatMessage) Reset() {
+	*x = MessageSetWireFormatMessage{}
+}
+
+func (x *MessageSetWireFormatMessage) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*MessageSetWireFormatMessage) ProtoMessage() {}
+
+func (x *MessageSetWireFormatMessage) ProtoReflect() protoreflect.Message {
+	return xxx_File_extensions_base_base_proto_messageTypes[1].MessageOf(x)
 }
-func (m *MessageSetWireFormatMessage) Reset()         { *m = MessageSetWireFormatMessage{} }
-func (m *MessageSetWireFormatMessage) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*MessageSetWireFormatMessage) ProtoMessage()    {}
 
 // Deprecated: Use MessageSetWireFormatMessage.ProtoReflect.Type instead.
 func (*MessageSetWireFormatMessage) Descriptor() ([]byte, []int) {

+ 111 - 58
cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go

@@ -21,13 +21,6 @@ const (
 	Enum_ZERO Enum = 0
 )
 
-func (e Enum) Type() protoreflect.EnumType {
-	return xxx_File_extensions_ext_ext_proto_enumTypes[0]
-}
-func (e Enum) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use Enum.Type.Values instead.
 var Enum_name = map[int32]string{
 	0: "ZERO",
@@ -46,6 +39,14 @@ func (x Enum) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (Enum) Type() protoreflect.EnumType {
+	return xxx_File_extensions_ext_ext_proto_enumTypes[0]
+}
+
+func (x Enum) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Do not use.
 func (x *Enum) UnmarshalJSON(b []byte) error {
 	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
@@ -68,21 +69,28 @@ type Message struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Message) ProtoReflect() protoreflect.Message {
-	return xxx_File_extensions_ext_ext_proto_messageTypes[0].MessageOf(m)
+func (x *Message) Reset() {
+	*x = Message{}
+}
+
+func (x *Message) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message) ProtoMessage() {}
+
+func (x *Message) ProtoReflect() protoreflect.Message {
+	return xxx_File_extensions_ext_ext_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Message) Reset()         { *m = Message{} }
-func (m *Message) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message) ProtoMessage()    {}
 
 // Deprecated: Use Message.ProtoReflect.Type instead.
 func (*Message) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_ext_ext_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *Message) GetData() []byte {
-	if m != nil {
-		return m.Data
+func (x *Message) GetData() []byte {
+	if x != nil {
+		return x.Data
 	}
 	return nil
 }
@@ -94,21 +102,28 @@ type ExtensionGroup struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *ExtensionGroup) ProtoReflect() protoreflect.Message {
-	return xxx_File_extensions_ext_ext_proto_messageTypes[1].MessageOf(m)
+func (x *ExtensionGroup) Reset() {
+	*x = ExtensionGroup{}
+}
+
+func (x *ExtensionGroup) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ExtensionGroup) ProtoMessage() {}
+
+func (x *ExtensionGroup) ProtoReflect() protoreflect.Message {
+	return xxx_File_extensions_ext_ext_proto_messageTypes[1].MessageOf(x)
 }
-func (m *ExtensionGroup) Reset()         { *m = ExtensionGroup{} }
-func (m *ExtensionGroup) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*ExtensionGroup) ProtoMessage()    {}
 
 // Deprecated: Use ExtensionGroup.ProtoReflect.Type instead.
 func (*ExtensionGroup) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_ext_ext_proto_rawDescGZIP(), []int{1}
 }
 
-func (m *ExtensionGroup) GetExtensionGroup() string {
-	if m != nil && m.ExtensionGroup != nil {
-		return *m.ExtensionGroup
+func (x *ExtensionGroup) GetExtensionGroup() string {
+	if x != nil && x.ExtensionGroup != nil {
+		return *x.ExtensionGroup
 	}
 	return ""
 }
@@ -120,12 +135,19 @@ type ExtendingMessage struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *ExtendingMessage) ProtoReflect() protoreflect.Message {
-	return xxx_File_extensions_ext_ext_proto_messageTypes[2].MessageOf(m)
+func (x *ExtendingMessage) Reset() {
+	*x = ExtendingMessage{}
+}
+
+func (x *ExtendingMessage) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ExtendingMessage) ProtoMessage() {}
+
+func (x *ExtendingMessage) ProtoReflect() protoreflect.Message {
+	return xxx_File_extensions_ext_ext_proto_messageTypes[2].MessageOf(x)
 }
-func (m *ExtendingMessage) Reset()         { *m = ExtendingMessage{} }
-func (m *ExtendingMessage) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*ExtendingMessage) ProtoMessage()    {}
 
 // Deprecated: Use ExtendingMessage.ProtoReflect.Type instead.
 func (*ExtendingMessage) Descriptor() ([]byte, []int) {
@@ -139,21 +161,28 @@ type RepeatedGroup struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *RepeatedGroup) ProtoReflect() protoreflect.Message {
-	return xxx_File_extensions_ext_ext_proto_messageTypes[3].MessageOf(m)
+func (x *RepeatedGroup) Reset() {
+	*x = RepeatedGroup{}
+}
+
+func (x *RepeatedGroup) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RepeatedGroup) ProtoMessage() {}
+
+func (x *RepeatedGroup) ProtoReflect() protoreflect.Message {
+	return xxx_File_extensions_ext_ext_proto_messageTypes[3].MessageOf(x)
 }
-func (m *RepeatedGroup) Reset()         { *m = RepeatedGroup{} }
-func (m *RepeatedGroup) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*RepeatedGroup) ProtoMessage()    {}
 
 // Deprecated: Use RepeatedGroup.ProtoReflect.Type instead.
 func (*RepeatedGroup) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_ext_ext_proto_rawDescGZIP(), []int{3}
 }
 
-func (m *RepeatedGroup) GetRepeatedXGroup() []string {
-	if m != nil {
-		return m.RepeatedXGroup
+func (x *RepeatedGroup) GetRepeatedXGroup() []string {
+	if x != nil {
+		return x.RepeatedXGroup
 	}
 	return nil
 }
@@ -166,12 +195,19 @@ type Extendable struct {
 	XXX_sizecache          int32                       `json:"-"`
 }
 
-func (m *Extendable) ProtoReflect() protoreflect.Message {
-	return xxx_File_extensions_ext_ext_proto_messageTypes[4].MessageOf(m)
+func (x *Extendable) Reset() {
+	*x = Extendable{}
+}
+
+func (x *Extendable) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Extendable) ProtoMessage() {}
+
+func (x *Extendable) ProtoReflect() protoreflect.Message {
+	return xxx_File_extensions_ext_ext_proto_messageTypes[4].MessageOf(x)
 }
-func (m *Extendable) Reset()         { *m = Extendable{} }
-func (m *Extendable) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Extendable) ProtoMessage()    {}
 
 // Deprecated: Use Extendable.ProtoReflect.Type instead.
 func (*Extendable) Descriptor() ([]byte, []int) {
@@ -194,12 +230,19 @@ type MessageSetWireFormatExtension struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *MessageSetWireFormatExtension) ProtoReflect() protoreflect.Message {
-	return xxx_File_extensions_ext_ext_proto_messageTypes[5].MessageOf(m)
+func (x *MessageSetWireFormatExtension) Reset() {
+	*x = MessageSetWireFormatExtension{}
+}
+
+func (x *MessageSetWireFormatExtension) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*MessageSetWireFormatExtension) ProtoMessage() {}
+
+func (x *MessageSetWireFormatExtension) ProtoReflect() protoreflect.Message {
+	return xxx_File_extensions_ext_ext_proto_messageTypes[5].MessageOf(x)
 }
-func (m *MessageSetWireFormatExtension) Reset()         { *m = MessageSetWireFormatExtension{} }
-func (m *MessageSetWireFormatExtension) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*MessageSetWireFormatExtension) ProtoMessage()    {}
 
 // Deprecated: Use MessageSetWireFormatExtension.ProtoReflect.Type instead.
 func (*MessageSetWireFormatExtension) Descriptor() ([]byte, []int) {
@@ -212,12 +255,19 @@ type Message_M struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Message_M) ProtoReflect() protoreflect.Message {
-	return xxx_File_extensions_ext_ext_proto_messageTypes[6].MessageOf(m)
+func (x *Message_M) Reset() {
+	*x = Message_M{}
+}
+
+func (x *Message_M) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message_M) ProtoMessage() {}
+
+func (x *Message_M) ProtoReflect() protoreflect.Message {
+	return xxx_File_extensions_ext_ext_proto_messageTypes[6].MessageOf(x)
 }
-func (m *Message_M) Reset()         { *m = Message_M{} }
-func (m *Message_M) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message_M) ProtoMessage()    {}
 
 // Deprecated: Use Message_M.ProtoReflect.Type instead.
 func (*Message_M) Descriptor() ([]byte, []int) {
@@ -230,17 +280,20 @@ type ExtendingMessage_ExtendingMessageSubmessage struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *ExtendingMessage_ExtendingMessageSubmessage) ProtoReflect() protoreflect.Message {
-	return xxx_File_extensions_ext_ext_proto_messageTypes[7].MessageOf(m)
-}
-func (m *ExtendingMessage_ExtendingMessageSubmessage) Reset() {
-	*m = ExtendingMessage_ExtendingMessageSubmessage{}
+func (x *ExtendingMessage_ExtendingMessageSubmessage) Reset() {
+	*x = ExtendingMessage_ExtendingMessageSubmessage{}
 }
-func (m *ExtendingMessage_ExtendingMessageSubmessage) String() string {
-	return protoimpl.X.MessageStringOf(m)
+
+func (x *ExtendingMessage_ExtendingMessageSubmessage) String() string {
+	return protoimpl.X.MessageStringOf(x)
 }
+
 func (*ExtendingMessage_ExtendingMessageSubmessage) ProtoMessage() {}
 
+func (x *ExtendingMessage_ExtendingMessageSubmessage) ProtoReflect() protoreflect.Message {
+	return xxx_File_extensions_ext_ext_proto_messageTypes[7].MessageOf(x)
+}
+
 // Deprecated: Use ExtendingMessage_ExtendingMessageSubmessage.ProtoReflect.Type instead.
 func (*ExtendingMessage_ExtendingMessageSubmessage) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_ext_ext_proto_rawDescGZIP(), []int{2, 0}

+ 15 - 8
cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go

@@ -19,21 +19,28 @@ type ExtraMessage struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *ExtraMessage) ProtoReflect() protoreflect.Message {
-	return xxx_File_extensions_extra_extra_proto_messageTypes[0].MessageOf(m)
+func (x *ExtraMessage) Reset() {
+	*x = ExtraMessage{}
+}
+
+func (x *ExtraMessage) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ExtraMessage) ProtoMessage() {}
+
+func (x *ExtraMessage) ProtoReflect() protoreflect.Message {
+	return xxx_File_extensions_extra_extra_proto_messageTypes[0].MessageOf(x)
 }
-func (m *ExtraMessage) Reset()         { *m = ExtraMessage{} }
-func (m *ExtraMessage) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*ExtraMessage) ProtoMessage()    {}
 
 // Deprecated: Use ExtraMessage.ProtoReflect.Type instead.
 func (*ExtraMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_extensions_extra_extra_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *ExtraMessage) GetData() []byte {
-	if m != nil {
-		return m.Data
+func (x *ExtraMessage) GetData() []byte {
+	if x != nil {
+		return x.Data
 	}
 	return nil
 }

+ 20 - 12
cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go

@@ -20,13 +20,6 @@ const (
 	Enum_ZERO Enum = 0
 )
 
-func (e Enum) Type() protoreflect.EnumType {
-	return xxx_File_extensions_proto3_ext3_proto_enumTypes[0]
-}
-func (e Enum) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use Enum.Type.Values instead.
 var Enum_name = map[int32]string{
 	0: "ZERO",
@@ -41,6 +34,14 @@ func (x Enum) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (Enum) Type() protoreflect.EnumType {
+	return xxx_File_extensions_proto3_ext3_proto_enumTypes[0]
+}
+
+func (x Enum) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Use Enum.Type instead.
 func (Enum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_extensions_proto3_ext3_proto_rawDescGZIP(), []int{0}
@@ -52,12 +53,19 @@ type Message struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Message) ProtoReflect() protoreflect.Message {
-	return xxx_File_extensions_proto3_ext3_proto_messageTypes[0].MessageOf(m)
+func (x *Message) Reset() {
+	*x = Message{}
+}
+
+func (x *Message) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message) ProtoMessage() {}
+
+func (x *Message) ProtoReflect() protoreflect.Message {
+	return xxx_File_extensions_proto3_ext3_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Message) Reset()         { *m = Message{} }
-func (m *Message) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message) ProtoMessage()    {}
 
 // Deprecated: Use Message.ProtoReflect.Type instead.
 func (*Message) Descriptor() ([]byte, []int) {

+ 74 - 60
cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go

@@ -57,112 +57,119 @@ type Message struct {
 	XXX_sizecache        int32                    `json:"-"`
 }
 
-func (m *Message) ProtoReflect() protoreflect.Message {
-	return xxx_File_fieldnames_fieldnames_proto_messageTypes[0].MessageOf(m)
+func (x *Message) Reset() {
+	*x = Message{}
+}
+
+func (x *Message) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message) ProtoMessage() {}
+
+func (x *Message) ProtoReflect() protoreflect.Message {
+	return xxx_File_fieldnames_fieldnames_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Message) Reset()         { *m = Message{} }
-func (m *Message) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message) ProtoMessage()    {}
 
 // Deprecated: Use Message.ProtoReflect.Type instead.
 func (*Message) Descriptor() ([]byte, []int) {
 	return xxx_File_fieldnames_fieldnames_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *Message) GetFieldOne() string {
-	if m != nil && m.FieldOne != nil {
-		return *m.FieldOne
+func (x *Message) GetFieldOne() string {
+	if x != nil && x.FieldOne != nil {
+		return *x.FieldOne
 	}
 	return ""
 }
 
-func (m *Message) GetFieldTwo() string {
-	if m != nil && m.FieldTwo != nil {
-		return *m.FieldTwo
+func (x *Message) GetFieldTwo() string {
+	if x != nil && x.FieldTwo != nil {
+		return *x.FieldTwo
 	}
 	return ""
 }
 
-func (m *Message) GetFieldThree() string {
-	if m != nil && m.FieldThree != nil {
-		return *m.FieldThree
+func (x *Message) GetFieldThree() string {
+	if x != nil && x.FieldThree != nil {
+		return *x.FieldThree
 	}
 	return ""
 }
 
-func (m *Message) GetField_Four() string {
-	if m != nil && m.Field_Four != nil {
-		return *m.Field_Four
+func (x *Message) GetField_Four() string {
+	if x != nil && x.Field_Four != nil {
+		return *x.Field_Four
 	}
 	return ""
 }
 
-func (m *Message) GetDescriptor_() string {
-	if m != nil && m.Descriptor_ != nil {
-		return *m.Descriptor_
+func (x *Message) GetDescriptor_() string {
+	if x != nil && x.Descriptor_ != nil {
+		return *x.Descriptor_
 	}
 	return ""
 }
 
-func (m *Message) GetMarshal_() string {
-	if m != nil && m.Marshal_ != nil {
-		return *m.Marshal_
+func (x *Message) GetMarshal_() string {
+	if x != nil && x.Marshal_ != nil {
+		return *x.Marshal_
 	}
 	return ""
 }
 
-func (m *Message) GetUnmarshal_() string {
-	if m != nil && m.Unmarshal_ != nil {
-		return *m.Unmarshal_
+func (x *Message) GetUnmarshal_() string {
+	if x != nil && x.Unmarshal_ != nil {
+		return *x.Unmarshal_
 	}
 	return ""
 }
 
-func (m *Message) GetProtoMessage_() string {
-	if m != nil && m.ProtoMessage_ != nil {
-		return *m.ProtoMessage_
+func (x *Message) GetProtoMessage_() string {
+	if x != nil && x.ProtoMessage_ != nil {
+		return *x.ProtoMessage_
 	}
 	return ""
 }
 
-func (m *Message) GetCamelCase() string {
-	if m != nil && m.CamelCase != nil {
-		return *m.CamelCase
+func (x *Message) GetCamelCase() string {
+	if x != nil && x.CamelCase != nil {
+		return *x.CamelCase
 	}
 	return ""
 }
 
-func (m *Message) GetCamelCase_() string {
-	if m != nil && m.CamelCase_ != nil {
-		return *m.CamelCase_
+func (x *Message) GetCamelCase_() string {
+	if x != nil && x.CamelCase_ != nil {
+		return *x.CamelCase_
 	}
 	return ""
 }
 
-func (m *Message) GetCamelCase__() string {
-	if m != nil && m.CamelCase__ != nil {
-		return *m.CamelCase__
+func (x *Message) GetCamelCase__() string {
+	if x != nil && x.CamelCase__ != nil {
+		return *x.CamelCase__
 	}
 	return ""
 }
 
-func (m *Message) GetCamelCase___() string {
-	if m != nil && m.CamelCase___ != nil {
-		return *m.CamelCase___
+func (x *Message) GetCamelCase___() string {
+	if x != nil && x.CamelCase___ != nil {
+		return *x.CamelCase___
 	}
 	return ""
 }
 
-func (m *Message) GetGetName() string {
-	if m != nil && m.GetName != nil {
-		return *m.GetName
+func (x *Message) GetGetName() string {
+	if x != nil && x.GetName != nil {
+		return *x.GetName
 	}
 	return ""
 }
 
-func (m *Message) GetName_() string {
-	if m != nil && m.Name_ != nil {
-		return *m.Name_
+func (x *Message) GetName_() string {
+	if x != nil && x.Name_ != nil {
+		return *x.Name_
 	}
 	return ""
 }
@@ -184,8 +191,8 @@ func (m *Message) GetOneofConflictA_() isMessage_OneofConflictA_ {
 	return nil
 }
 
-func (m *Message) GetOneofConflictA() string {
-	if x, ok := m.GetOneofConflictA_().(*Message_OneofConflictA); ok {
+func (x *Message) GetOneofConflictA() string {
+	if x, ok := x.GetOneofConflictA_().(*Message_OneofConflictA); ok {
 		return x.OneofConflictA
 	}
 	return ""
@@ -214,15 +221,15 @@ func (m *Message) GetOneofConflictB() isMessage_OneofConflictB {
 	return nil
 }
 
-func (m *Message) GetOneofNoConflict() string {
-	if x, ok := m.GetOneofConflictB().(*Message_OneofNoConflict); ok {
+func (x *Message) GetOneofNoConflict() string {
+	if x, ok := x.GetOneofConflictB().(*Message_OneofNoConflict); ok {
 		return x.OneofNoConflict
 	}
 	return ""
 }
 
-func (m *Message) GetOneofConflictB_() string {
-	if x, ok := m.GetOneofConflictB().(*Message_OneofConflictB_); ok {
+func (x *Message) GetOneofConflictB_() string {
+	if x, ok := x.GetOneofConflictB().(*Message_OneofConflictB_); ok {
 		return x.OneofConflictB_
 	}
 	return ""
@@ -245,8 +252,8 @@ func (m *Message) GetOneofConflictC() isMessage_OneofConflictC {
 	return nil
 }
 
-func (m *Message) GetOneofMessageConflict() string {
-	if x, ok := m.GetOneofConflictC().(*Message_OneofMessageConflict_); ok {
+func (x *Message) GetOneofMessageConflict() string {
+	if x, ok := x.GetOneofConflictC().(*Message_OneofMessageConflict_); ok {
 		return x.OneofMessageConflict
 	}
 	return ""
@@ -268,12 +275,19 @@ type Message_OneofMessageConflict struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Message_OneofMessageConflict) ProtoReflect() protoreflect.Message {
-	return xxx_File_fieldnames_fieldnames_proto_messageTypes[1].MessageOf(m)
+func (x *Message_OneofMessageConflict) Reset() {
+	*x = Message_OneofMessageConflict{}
+}
+
+func (x *Message_OneofMessageConflict) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message_OneofMessageConflict) ProtoMessage() {}
+
+func (x *Message_OneofMessageConflict) ProtoReflect() protoreflect.Message {
+	return xxx_File_fieldnames_fieldnames_proto_messageTypes[1].MessageOf(x)
 }
-func (m *Message_OneofMessageConflict) Reset()         { *m = Message_OneofMessageConflict{} }
-func (m *Message_OneofMessageConflict) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message_OneofMessageConflict) ProtoMessage()    {}
 
 // Deprecated: Use Message_OneofMessageConflict.ProtoReflect.Type instead.
 func (*Message_OneofMessageConflict) Descriptor() ([]byte, []int) {

+ 21 - 14
cmd/protoc-gen-go/testdata/import_public/a.pb.go

@@ -65,35 +65,42 @@ type Public struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Public) ProtoReflect() protoreflect.Message {
-	return xxx_File_import_public_a_proto_messageTypes[0].MessageOf(m)
+func (x *Public) Reset() {
+	*x = Public{}
+}
+
+func (x *Public) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Public) ProtoMessage() {}
+
+func (x *Public) ProtoReflect() protoreflect.Message {
+	return xxx_File_import_public_a_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Public) Reset()         { *m = Public{} }
-func (m *Public) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Public) ProtoMessage()    {}
 
 // Deprecated: Use Public.ProtoReflect.Type instead.
 func (*Public) Descriptor() ([]byte, []int) {
 	return xxx_File_import_public_a_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *Public) GetM() *sub.M {
-	if m != nil {
-		return m.M
+func (x *Public) GetM() *sub.M {
+	if x != nil {
+		return x.M
 	}
 	return nil
 }
 
-func (m *Public) GetE() sub.E {
-	if m != nil && m.E != nil {
-		return *m.E
+func (x *Public) GetE() sub.E {
+	if x != nil && x.E != nil {
+		return *x.E
 	}
 	return sub.E_ZERO
 }
 
-func (m *Public) GetLocal() *Local {
-	if m != nil {
-		return m.Local
+func (x *Public) GetLocal() *Local {
+	if x != nil {
+		return x.Local
 	}
 	return nil
 }

+ 18 - 11
cmd/protoc-gen-go/testdata/import_public/b.pb.go

@@ -21,28 +21,35 @@ type Local struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Local) ProtoReflect() protoreflect.Message {
-	return xxx_File_import_public_b_proto_messageTypes[0].MessageOf(m)
+func (x *Local) Reset() {
+	*x = Local{}
+}
+
+func (x *Local) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Local) ProtoMessage() {}
+
+func (x *Local) ProtoReflect() protoreflect.Message {
+	return xxx_File_import_public_b_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Local) Reset()         { *m = Local{} }
-func (m *Local) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Local) ProtoMessage()    {}
 
 // Deprecated: Use Local.ProtoReflect.Type instead.
 func (*Local) Descriptor() ([]byte, []int) {
 	return xxx_File_import_public_b_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *Local) GetM() *sub.M {
-	if m != nil {
-		return m.M
+func (x *Local) GetM() *sub.M {
+	if x != nil {
+		return x.M
 	}
 	return nil
 }
 
-func (m *Local) GetE() sub.E {
-	if m != nil && m.E != nil {
-		return *m.E
+func (x *Local) GetE() sub.E {
+	if x != nil && x.E != nil {
+		return *x.E
 	}
 	return sub.E_ZERO
 }

+ 68 - 51
cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go

@@ -25,13 +25,6 @@ const (
 	E_ZERO E = 0
 )
 
-func (e E) Type() protoreflect.EnumType {
-	return xxx_File_import_public_sub_a_proto_enumTypes[0]
-}
-func (e E) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use E.Type.Values instead.
 var E_name = map[int32]string{
 	0: "ZERO",
@@ -50,6 +43,14 @@ func (x E) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (E) Type() protoreflect.EnumType {
+	return xxx_File_import_public_sub_a_proto_enumTypes[0]
+}
+
+func (x E) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Do not use.
 func (x *E) UnmarshalJSON(b []byte) error {
 	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
@@ -71,13 +72,6 @@ const (
 	M_M_ZERO M_Subenum = 0
 )
 
-func (e M_Subenum) Type() protoreflect.EnumType {
-	return xxx_File_import_public_sub_a_proto_enumTypes[1]
-}
-func (e M_Subenum) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use M_Subenum.Type.Values instead.
 var M_Subenum_name = map[int32]string{
 	0: "M_ZERO",
@@ -96,6 +90,14 @@ func (x M_Subenum) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (M_Subenum) Type() protoreflect.EnumType {
+	return xxx_File_import_public_sub_a_proto_enumTypes[1]
+}
+
+func (x M_Subenum) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Do not use.
 func (x *M_Subenum) UnmarshalJSON(b []byte) error {
 	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
@@ -117,13 +119,6 @@ const (
 	M_Submessage_M_SUBMESSAGE_ZERO M_Submessage_Submessage_Subenum = 0
 )
 
-func (e M_Submessage_Submessage_Subenum) Type() protoreflect.EnumType {
-	return xxx_File_import_public_sub_a_proto_enumTypes[2]
-}
-func (e M_Submessage_Submessage_Subenum) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use M_Submessage_Submessage_Subenum.Type.Values instead.
 var M_Submessage_Submessage_Subenum_name = map[int32]string{
 	0: "M_SUBMESSAGE_ZERO",
@@ -142,6 +137,14 @@ func (x M_Submessage_Submessage_Subenum) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (M_Submessage_Submessage_Subenum) Type() protoreflect.EnumType {
+	return xxx_File_import_public_sub_a_proto_enumTypes[2]
+}
+
+func (x M_Submessage_Submessage_Subenum) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Do not use.
 func (x *M_Submessage_Submessage_Subenum) UnmarshalJSON(b []byte) error {
 	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
@@ -173,12 +176,19 @@ type M struct {
 	XXX_sizecache          int32                       `json:"-"`
 }
 
-func (m *M) ProtoReflect() protoreflect.Message {
-	return xxx_File_import_public_sub_a_proto_messageTypes[0].MessageOf(m)
+func (x *M) Reset() {
+	*x = M{}
+}
+
+func (x *M) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*M) ProtoMessage() {}
+
+func (x *M) ProtoReflect() protoreflect.Message {
+	return xxx_File_import_public_sub_a_proto_messageTypes[0].MessageOf(x)
 }
-func (m *M) Reset()         { *m = M{} }
-func (m *M) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*M) ProtoMessage()    {}
 
 // Deprecated: Use M.ProtoReflect.Type instead.
 func (*M) Descriptor() ([]byte, []int) {
@@ -199,30 +209,30 @@ const Default_M_S string = "default"
 var Default_M_B []byte = []byte("default")
 var Default_M_F float64 = math.NaN()
 
-func (m *M) GetM2() *M2 {
-	if m != nil {
-		return m.M2
+func (x *M) GetM2() *M2 {
+	if x != nil {
+		return x.M2
 	}
 	return nil
 }
 
-func (m *M) GetS() string {
-	if m != nil && m.S != nil {
-		return *m.S
+func (x *M) GetS() string {
+	if x != nil && x.S != nil {
+		return *x.S
 	}
 	return Default_M_S
 }
 
-func (m *M) GetB() []byte {
-	if m != nil && m.B != nil {
-		return m.B
+func (x *M) GetB() []byte {
+	if x != nil && x.B != nil {
+		return x.B
 	}
 	return append([]byte(nil), Default_M_B...)
 }
 
-func (m *M) GetF() float64 {
-	if m != nil && m.F != nil {
-		return *m.F
+func (x *M) GetF() float64 {
+	if x != nil && x.F != nil {
+		return *x.F
 	}
 	return Default_M_F
 }
@@ -250,15 +260,15 @@ func (m *M) GetOneofField() isM_OneofField {
 	return nil
 }
 
-func (m *M) GetOneofInt32() int32 {
-	if x, ok := m.GetOneofField().(*M_OneofInt32); ok {
+func (x *M) GetOneofInt32() int32 {
+	if x, ok := x.GetOneofField().(*M_OneofInt32); ok {
 		return x.OneofInt32
 	}
 	return 0
 }
 
-func (m *M) GetOneofInt64() int64 {
-	if x, ok := m.GetOneofField().(*M_OneofInt64); ok {
+func (x *M) GetOneofInt64() int64 {
+	if x, ok := x.GetOneofField().(*M_OneofInt64); ok {
 		return x.OneofInt64
 	}
 	return 0
@@ -282,12 +292,19 @@ type M_Submessage struct {
 	XXX_sizecache        int32                               `json:"-"`
 }
 
-func (m *M_Submessage) ProtoReflect() protoreflect.Message {
-	return xxx_File_import_public_sub_a_proto_messageTypes[1].MessageOf(m)
+func (x *M_Submessage) Reset() {
+	*x = M_Submessage{}
+}
+
+func (x *M_Submessage) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*M_Submessage) ProtoMessage() {}
+
+func (x *M_Submessage) ProtoReflect() protoreflect.Message {
+	return xxx_File_import_public_sub_a_proto_messageTypes[1].MessageOf(x)
 }
-func (m *M_Submessage) Reset()         { *m = M_Submessage{} }
-func (m *M_Submessage) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*M_Submessage) ProtoMessage()    {}
 
 // Deprecated: Use M_Submessage.ProtoReflect.Type instead.
 func (*M_Submessage) Descriptor() ([]byte, []int) {
@@ -317,15 +334,15 @@ func (m *M_Submessage) GetSubmessageOneofField() isM_Submessage_SubmessageOneofF
 	return nil
 }
 
-func (m *M_Submessage) GetSubmessageOneofInt32() int32 {
-	if x, ok := m.GetSubmessageOneofField().(*M_Submessage_SubmessageOneofInt32); ok {
+func (x *M_Submessage) GetSubmessageOneofInt32() int32 {
+	if x, ok := x.GetSubmessageOneofField().(*M_Submessage_SubmessageOneofInt32); ok {
 		return x.SubmessageOneofInt32
 	}
 	return 0
 }
 
-func (m *M_Submessage) GetSubmessageOneofInt64() int64 {
-	if x, ok := m.GetSubmessageOneofField().(*M_Submessage_SubmessageOneofInt64); ok {
+func (x *M_Submessage) GetSubmessageOneofInt64() int64 {
+	if x, ok := x.GetSubmessageOneofField().(*M_Submessage_SubmessageOneofInt64); ok {
 		return x.SubmessageOneofInt64
 	}
 	return 0

+ 12 - 5
cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go

@@ -18,12 +18,19 @@ type M2 struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *M2) ProtoReflect() protoreflect.Message {
-	return xxx_File_import_public_sub_b_proto_messageTypes[0].MessageOf(m)
+func (x *M2) Reset() {
+	*x = M2{}
+}
+
+func (x *M2) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*M2) ProtoMessage() {}
+
+func (x *M2) ProtoReflect() protoreflect.Message {
+	return xxx_File_import_public_sub_b_proto_messageTypes[0].MessageOf(x)
 }
-func (m *M2) Reset()         { *m = M2{} }
-func (m *M2) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*M2) ProtoMessage()    {}
 
 // Deprecated: Use M2.ProtoReflect.Type instead.
 func (*M2) Descriptor() ([]byte, []int) {

+ 12 - 5
cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go

@@ -18,12 +18,19 @@ type Sub2Message struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Sub2Message) ProtoReflect() protoreflect.Message {
-	return xxx_File_import_public_sub2_a_proto_messageTypes[0].MessageOf(m)
+func (x *Sub2Message) Reset() {
+	*x = Sub2Message{}
+}
+
+func (x *Sub2Message) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Sub2Message) ProtoMessage() {}
+
+func (x *Sub2Message) ProtoReflect() protoreflect.Message {
+	return xxx_File_import_public_sub2_a_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Sub2Message) Reset()         { *m = Sub2Message{} }
-func (m *Sub2Message) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Sub2Message) ProtoMessage()    {}
 
 // Deprecated: Use Sub2Message.ProtoReflect.Type instead.
 func (*Sub2Message) Descriptor() ([]byte, []int) {

+ 12 - 5
cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go

@@ -18,12 +18,19 @@ type M struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *M) ProtoReflect() protoreflect.Message {
-	return xxx_File_imports_fmt_m_proto_messageTypes[0].MessageOf(m)
+func (x *M) Reset() {
+	*x = M{}
+}
+
+func (x *M) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*M) ProtoMessage() {}
+
+func (x *M) ProtoReflect() protoreflect.Message {
+	return xxx_File_imports_fmt_m_proto_messageTypes[0].MessageOf(x)
 }
-func (m *M) Reset()         { *m = M{} }
-func (m *M) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*M) ProtoMessage()    {}
 
 // Deprecated: Use M.ProtoReflect.Type instead.
 func (*M) Descriptor() ([]byte, []int) {

+ 35 - 20
cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go

@@ -18,13 +18,6 @@ const (
 	E1_E1_ZERO E1 = 0
 )
 
-func (e E1) Type() protoreflect.EnumType {
-	return xxx_File_imports_test_a_1_m1_proto_enumTypes[0]
-}
-func (e E1) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use E1.Type.Values instead.
 var E1_name = map[int32]string{
 	0: "E1_ZERO",
@@ -39,6 +32,14 @@ func (x E1) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (E1) Type() protoreflect.EnumType {
+	return xxx_File_imports_test_a_1_m1_proto_enumTypes[0]
+}
+
+func (x E1) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Use E1.Type instead.
 func (E1) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_imports_test_a_1_m1_proto_rawDescGZIP(), []int{0}
@@ -50,12 +51,19 @@ type M1 struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *M1) ProtoReflect() protoreflect.Message {
-	return xxx_File_imports_test_a_1_m1_proto_messageTypes[0].MessageOf(m)
+func (x *M1) Reset() {
+	*x = M1{}
+}
+
+func (x *M1) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*M1) ProtoMessage() {}
+
+func (x *M1) ProtoReflect() protoreflect.Message {
+	return xxx_File_imports_test_a_1_m1_proto_messageTypes[0].MessageOf(x)
 }
-func (m *M1) Reset()         { *m = M1{} }
-func (m *M1) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*M1) ProtoMessage()    {}
 
 // Deprecated: Use M1.ProtoReflect.Type instead.
 func (*M1) Descriptor() ([]byte, []int) {
@@ -69,21 +77,28 @@ type M1_1 struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *M1_1) ProtoReflect() protoreflect.Message {
-	return xxx_File_imports_test_a_1_m1_proto_messageTypes[1].MessageOf(m)
+func (x *M1_1) Reset() {
+	*x = M1_1{}
+}
+
+func (x *M1_1) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*M1_1) ProtoMessage() {}
+
+func (x *M1_1) ProtoReflect() protoreflect.Message {
+	return xxx_File_imports_test_a_1_m1_proto_messageTypes[1].MessageOf(x)
 }
-func (m *M1_1) Reset()         { *m = M1_1{} }
-func (m *M1_1) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*M1_1) ProtoMessage()    {}
 
 // Deprecated: Use M1_1.ProtoReflect.Type instead.
 func (*M1_1) Descriptor() ([]byte, []int) {
 	return xxx_File_imports_test_a_1_m1_proto_rawDescGZIP(), []int{1}
 }
 
-func (m *M1_1) GetM1() *M1 {
-	if m != nil {
-		return m.M1
+func (x *M1_1) GetM1() *M1 {
+	if x != nil {
+		return x.M1
 	}
 	return nil
 }

+ 12 - 5
cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go

@@ -18,12 +18,19 @@ type M2 struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *M2) ProtoReflect() protoreflect.Message {
-	return xxx_File_imports_test_a_1_m2_proto_messageTypes[0].MessageOf(m)
+func (x *M2) Reset() {
+	*x = M2{}
+}
+
+func (x *M2) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*M2) ProtoMessage() {}
+
+func (x *M2) ProtoReflect() protoreflect.Message {
+	return xxx_File_imports_test_a_1_m2_proto_messageTypes[0].MessageOf(x)
 }
-func (m *M2) Reset()         { *m = M2{} }
-func (m *M2) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*M2) ProtoMessage()    {}
 
 // Deprecated: Use M2.ProtoReflect.Type instead.
 func (*M2) Descriptor() ([]byte, []int) {

+ 12 - 5
cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go

@@ -18,12 +18,19 @@ type M3 struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *M3) ProtoReflect() protoreflect.Message {
-	return xxx_File_imports_test_a_2_m3_proto_messageTypes[0].MessageOf(m)
+func (x *M3) Reset() {
+	*x = M3{}
+}
+
+func (x *M3) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*M3) ProtoMessage() {}
+
+func (x *M3) ProtoReflect() protoreflect.Message {
+	return xxx_File_imports_test_a_2_m3_proto_messageTypes[0].MessageOf(x)
 }
-func (m *M3) Reset()         { *m = M3{} }
-func (m *M3) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*M3) ProtoMessage()    {}
 
 // Deprecated: Use M3.ProtoReflect.Type instead.
 func (*M3) Descriptor() ([]byte, []int) {

+ 12 - 5
cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go

@@ -18,12 +18,19 @@ type M4 struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *M4) ProtoReflect() protoreflect.Message {
-	return xxx_File_imports_test_a_2_m4_proto_messageTypes[0].MessageOf(m)
+func (x *M4) Reset() {
+	*x = M4{}
+}
+
+func (x *M4) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*M4) ProtoMessage() {}
+
+func (x *M4) ProtoReflect() protoreflect.Message {
+	return xxx_File_imports_test_a_2_m4_proto_messageTypes[0].MessageOf(x)
 }
-func (m *M4) Reset()         { *m = M4{} }
-func (m *M4) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*M4) ProtoMessage()    {}
 
 // Deprecated: Use M4.ProtoReflect.Type instead.
 func (*M4) Descriptor() ([]byte, []int) {

+ 12 - 5
cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go

@@ -18,12 +18,19 @@ type M1 struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *M1) ProtoReflect() protoreflect.Message {
-	return xxx_File_imports_test_b_1_m1_proto_messageTypes[0].MessageOf(m)
+func (x *M1) Reset() {
+	*x = M1{}
+}
+
+func (x *M1) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*M1) ProtoMessage() {}
+
+func (x *M1) ProtoReflect() protoreflect.Message {
+	return xxx_File_imports_test_b_1_m1_proto_messageTypes[0].MessageOf(x)
 }
-func (m *M1) Reset()         { *m = M1{} }
-func (m *M1) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*M1) ProtoMessage()    {}
 
 // Deprecated: Use M1.ProtoReflect.Type instead.
 func (*M1) Descriptor() ([]byte, []int) {

+ 12 - 5
cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go

@@ -18,12 +18,19 @@ type M2 struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *M2) ProtoReflect() protoreflect.Message {
-	return xxx_File_imports_test_b_1_m2_proto_messageTypes[0].MessageOf(m)
+func (x *M2) Reset() {
+	*x = M2{}
+}
+
+func (x *M2) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*M2) ProtoMessage() {}
+
+func (x *M2) ProtoReflect() protoreflect.Message {
+	return xxx_File_imports_test_b_1_m2_proto_messageTypes[0].MessageOf(x)
 }
-func (m *M2) Reset()         { *m = M2{} }
-func (m *M2) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*M2) ProtoMessage()    {}
 
 // Deprecated: Use M2.ProtoReflect.Type instead.
 func (*M2) Descriptor() ([]byte, []int) {

+ 15 - 8
cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go

@@ -20,21 +20,28 @@ type A1M1 struct {
 	XXX_sizecache        int32        `json:"-"`
 }
 
-func (m *A1M1) ProtoReflect() protoreflect.Message {
-	return xxx_File_imports_test_import_a1m1_proto_messageTypes[0].MessageOf(m)
+func (x *A1M1) Reset() {
+	*x = A1M1{}
+}
+
+func (x *A1M1) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*A1M1) ProtoMessage() {}
+
+func (x *A1M1) ProtoReflect() protoreflect.Message {
+	return xxx_File_imports_test_import_a1m1_proto_messageTypes[0].MessageOf(x)
 }
-func (m *A1M1) Reset()         { *m = A1M1{} }
-func (m *A1M1) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*A1M1) ProtoMessage()    {}
 
 // Deprecated: Use A1M1.ProtoReflect.Type instead.
 func (*A1M1) Descriptor() ([]byte, []int) {
 	return xxx_File_imports_test_import_a1m1_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *A1M1) GetF() *test_a_1.M1 {
-	if m != nil {
-		return m.F
+func (x *A1M1) GetF() *test_a_1.M1 {
+	if x != nil {
+		return x.F
 	}
 	return nil
 }

+ 15 - 8
cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go

@@ -20,21 +20,28 @@ type A1M2 struct {
 	XXX_sizecache        int32        `json:"-"`
 }
 
-func (m *A1M2) ProtoReflect() protoreflect.Message {
-	return xxx_File_imports_test_import_a1m2_proto_messageTypes[0].MessageOf(m)
+func (x *A1M2) Reset() {
+	*x = A1M2{}
+}
+
+func (x *A1M2) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*A1M2) ProtoMessage() {}
+
+func (x *A1M2) ProtoReflect() protoreflect.Message {
+	return xxx_File_imports_test_import_a1m2_proto_messageTypes[0].MessageOf(x)
 }
-func (m *A1M2) Reset()         { *m = A1M2{} }
-func (m *A1M2) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*A1M2) ProtoMessage()    {}
 
 // Deprecated: Use A1M2.ProtoReflect.Type instead.
 func (*A1M2) Descriptor() ([]byte, []int) {
 	return xxx_File_imports_test_import_a1m2_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *A1M2) GetF() *test_a_1.M2 {
-	if m != nil {
-		return m.F
+func (x *A1M2) GetF() *test_a_1.M2 {
+	if x != nil {
+		return x.F
 	}
 	return nil
 }

+ 27 - 20
cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go

@@ -27,49 +27,56 @@ type All struct {
 	XXX_sizecache        int32        `json:"-"`
 }
 
-func (m *All) ProtoReflect() protoreflect.Message {
-	return xxx_File_imports_test_import_all_proto_messageTypes[0].MessageOf(m)
+func (x *All) Reset() {
+	*x = All{}
+}
+
+func (x *All) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*All) ProtoMessage() {}
+
+func (x *All) ProtoReflect() protoreflect.Message {
+	return xxx_File_imports_test_import_all_proto_messageTypes[0].MessageOf(x)
 }
-func (m *All) Reset()         { *m = All{} }
-func (m *All) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*All) ProtoMessage()    {}
 
 // Deprecated: Use All.ProtoReflect.Type instead.
 func (*All) Descriptor() ([]byte, []int) {
 	return xxx_File_imports_test_import_all_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *All) GetAm1() *test_a_1.M1 {
-	if m != nil {
-		return m.Am1
+func (x *All) GetAm1() *test_a_1.M1 {
+	if x != nil {
+		return x.Am1
 	}
 	return nil
 }
 
-func (m *All) GetAm2() *test_a_1.M2 {
-	if m != nil {
-		return m.Am2
+func (x *All) GetAm2() *test_a_1.M2 {
+	if x != nil {
+		return x.Am2
 	}
 	return nil
 }
 
-func (m *All) GetBm1() *test_b_1.M1 {
-	if m != nil {
-		return m.Bm1
+func (x *All) GetBm1() *test_b_1.M1 {
+	if x != nil {
+		return x.Bm1
 	}
 	return nil
 }
 
-func (m *All) GetBm2() *test_b_1.M2 {
-	if m != nil {
-		return m.Bm2
+func (x *All) GetBm2() *test_b_1.M2 {
+	if x != nil {
+		return x.Bm2
 	}
 	return nil
 }
 
-func (m *All) GetFmt() *fmt.M {
-	if m != nil {
-		return m.Fmt
+func (x *All) GetFmt() *fmt.M {
+	if x != nil {
+		return x.Fmt
 	}
 	return nil
 }

+ 14 - 7
cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go

@@ -21,12 +21,19 @@ type Foo struct {
 	XXX_sizecache        int32     `json:"-"`
 }
 
-func (m *Foo) ProtoReflect() protoreflect.Message {
-	return xxx_File_issue780_oneof_conflict_test_proto_messageTypes[0].MessageOf(m)
+func (x *Foo) Reset() {
+	*x = Foo{}
+}
+
+func (x *Foo) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Foo) ProtoMessage() {}
+
+func (x *Foo) ProtoReflect() protoreflect.Message {
+	return xxx_File_issue780_oneof_conflict_test_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Foo) Reset()         { *m = Foo{} }
-func (m *Foo) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Foo) ProtoMessage()    {}
 
 // Deprecated: Use Foo.ProtoReflect.Type instead.
 func (*Foo) Descriptor() ([]byte, []int) {
@@ -50,8 +57,8 @@ func (m *Foo) GetBar() isFoo_Bar {
 	return nil
 }
 
-func (m *Foo) GetGetBar() string {
-	if x, ok := m.GetBar().(*Foo_GetBar); ok {
+func (x *Foo) GetGetBar() string {
+	if x, ok := x.GetBar().(*Foo_GetBar); ok {
 		return x.GetBar
 	}
 	return ""

+ 26 - 18
cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go

@@ -18,13 +18,6 @@ const (
 	Enum_ZERO Enum = 0
 )
 
-func (e Enum) Type() protoreflect.EnumType {
-	return xxx_File_nopackage_nopackage_proto_enumTypes[0]
-}
-func (e Enum) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use Enum.Type.Values instead.
 var Enum_name = map[int32]string{
 	0: "ZERO",
@@ -43,6 +36,14 @@ func (x Enum) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (Enum) Type() protoreflect.EnumType {
+	return xxx_File_nopackage_nopackage_proto_enumTypes[0]
+}
+
+func (x Enum) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Do not use.
 func (x *Enum) UnmarshalJSON(b []byte) error {
 	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
@@ -66,12 +67,19 @@ type Message struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Message) ProtoReflect() protoreflect.Message {
-	return xxx_File_nopackage_nopackage_proto_messageTypes[0].MessageOf(m)
+func (x *Message) Reset() {
+	*x = Message{}
+}
+
+func (x *Message) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message) ProtoMessage() {}
+
+func (x *Message) ProtoReflect() protoreflect.Message {
+	return xxx_File_nopackage_nopackage_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Message) Reset()         { *m = Message{} }
-func (m *Message) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message) ProtoMessage()    {}
 
 // Deprecated: Use Message.ProtoReflect.Type instead.
 func (*Message) Descriptor() ([]byte, []int) {
@@ -80,16 +88,16 @@ func (*Message) Descriptor() ([]byte, []int) {
 
 const Default_Message_EnumField Enum = Enum_ZERO
 
-func (m *Message) GetStringField() string {
-	if m != nil && m.StringField != nil {
-		return *m.StringField
+func (x *Message) GetStringField() string {
+	if x != nil && x.StringField != nil {
+		return *x.StringField
 	}
 	return ""
 }
 
-func (m *Message) GetEnumField() Enum {
-	if m != nil && m.EnumField != nil {
-		return *m.EnumField
+func (x *Message) GetEnumField() Enum {
+	if x != nil && x.EnumField != nil {
+		return *x.EnumField
 	}
 	return Default_Message_EnumField
 }

+ 76 - 60
cmd/protoc-gen-go/testdata/proto2/enum.pb.go

@@ -22,13 +22,6 @@ const (
 	EnumType1_TWO EnumType1 = 2
 )
 
-func (e EnumType1) Type() protoreflect.EnumType {
-	return xxx_File_proto2_enum_proto_enumTypes[0]
-}
-func (e EnumType1) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use EnumType1.Type.Values instead.
 var EnumType1_name = map[int32]string{
 	1: "ONE",
@@ -49,6 +42,14 @@ func (x EnumType1) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (EnumType1) Type() protoreflect.EnumType {
+	return xxx_File_proto2_enum_proto_enumTypes[0]
+}
+
+func (x EnumType1) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Do not use.
 func (x *EnumType1) UnmarshalJSON(b []byte) error {
 	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
@@ -71,13 +72,6 @@ const (
 	EnumType2_duplicate2 EnumType2 = 1
 )
 
-func (e EnumType2) Type() protoreflect.EnumType {
-	return xxx_File_proto2_enum_proto_enumTypes[1]
-}
-func (e EnumType2) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use EnumType2.Type.Values instead.
 var EnumType2_name = map[int32]string{
 	1: "duplicate1",
@@ -98,6 +92,14 @@ func (x EnumType2) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (EnumType2) Type() protoreflect.EnumType {
+	return xxx_File_proto2_enum_proto_enumTypes[1]
+}
+
+func (x EnumType2) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Do not use.
 func (x *EnumType2) UnmarshalJSON(b []byte) error {
 	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
@@ -121,13 +123,6 @@ const (
 	EnumContainerMessage1_NESTED_1A_VALUE EnumContainerMessage1_NestedEnumType1A = 0
 )
 
-func (e EnumContainerMessage1_NestedEnumType1A) Type() protoreflect.EnumType {
-	return xxx_File_proto2_enum_proto_enumTypes[2]
-}
-func (e EnumContainerMessage1_NestedEnumType1A) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use EnumContainerMessage1_NestedEnumType1A.Type.Values instead.
 var EnumContainerMessage1_NestedEnumType1A_name = map[int32]string{
 	0: "NESTED_1A_VALUE",
@@ -146,6 +141,14 @@ func (x EnumContainerMessage1_NestedEnumType1A) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (EnumContainerMessage1_NestedEnumType1A) Type() protoreflect.EnumType {
+	return xxx_File_proto2_enum_proto_enumTypes[2]
+}
+
+func (x EnumContainerMessage1_NestedEnumType1A) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Do not use.
 func (x *EnumContainerMessage1_NestedEnumType1A) UnmarshalJSON(b []byte) error {
 	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
@@ -167,13 +170,6 @@ const (
 	EnumContainerMessage1_NESTED_1B_VALUE EnumContainerMessage1_NestedEnumType1B = 0
 )
 
-func (e EnumContainerMessage1_NestedEnumType1B) Type() protoreflect.EnumType {
-	return xxx_File_proto2_enum_proto_enumTypes[3]
-}
-func (e EnumContainerMessage1_NestedEnumType1B) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use EnumContainerMessage1_NestedEnumType1B.Type.Values instead.
 var EnumContainerMessage1_NestedEnumType1B_name = map[int32]string{
 	0: "NESTED_1B_VALUE",
@@ -192,6 +188,14 @@ func (x EnumContainerMessage1_NestedEnumType1B) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (EnumContainerMessage1_NestedEnumType1B) Type() protoreflect.EnumType {
+	return xxx_File_proto2_enum_proto_enumTypes[3]
+}
+
+func (x EnumContainerMessage1_NestedEnumType1B) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Do not use.
 func (x *EnumContainerMessage1_NestedEnumType1B) UnmarshalJSON(b []byte) error {
 	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
@@ -215,13 +219,6 @@ const (
 	EnumContainerMessage1_EnumContainerMessage2_NESTED_2A_VALUE EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A = 0
 )
 
-func (e EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) Type() protoreflect.EnumType {
-	return xxx_File_proto2_enum_proto_enumTypes[4]
-}
-func (e EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A.Type.Values instead.
 var EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_name = map[int32]string{
 	0: "NESTED_2A_VALUE",
@@ -240,6 +237,14 @@ func (x EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) String() s
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) Type() protoreflect.EnumType {
+	return xxx_File_proto2_enum_proto_enumTypes[4]
+}
+
+func (x EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Do not use.
 func (x *EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) UnmarshalJSON(b []byte) error {
 	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
@@ -261,13 +266,6 @@ const (
 	EnumContainerMessage1_EnumContainerMessage2_NESTED_2B_VALUE EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B = 0
 )
 
-func (e EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) Type() protoreflect.EnumType {
-	return xxx_File_proto2_enum_proto_enumTypes[5]
-}
-func (e EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B.Type.Values instead.
 var EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_name = map[int32]string{
 	0: "NESTED_2B_VALUE",
@@ -286,6 +284,14 @@ func (x EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) String() s
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) Type() protoreflect.EnumType {
+	return xxx_File_proto2_enum_proto_enumTypes[5]
+}
+
+func (x EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Do not use.
 func (x *EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) UnmarshalJSON(b []byte) error {
 	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
@@ -309,12 +315,19 @@ type EnumContainerMessage1 struct {
 	XXX_sizecache        int32      `json:"-"`
 }
 
-func (m *EnumContainerMessage1) ProtoReflect() protoreflect.Message {
-	return xxx_File_proto2_enum_proto_messageTypes[0].MessageOf(m)
+func (x *EnumContainerMessage1) Reset() {
+	*x = EnumContainerMessage1{}
+}
+
+func (x *EnumContainerMessage1) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EnumContainerMessage1) ProtoMessage() {}
+
+func (x *EnumContainerMessage1) ProtoReflect() protoreflect.Message {
+	return xxx_File_proto2_enum_proto_messageTypes[0].MessageOf(x)
 }
-func (m *EnumContainerMessage1) Reset()         { *m = EnumContainerMessage1{} }
-func (m *EnumContainerMessage1) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*EnumContainerMessage1) ProtoMessage()    {}
 
 // Deprecated: Use EnumContainerMessage1.ProtoReflect.Type instead.
 func (*EnumContainerMessage1) Descriptor() ([]byte, []int) {
@@ -324,16 +337,16 @@ func (*EnumContainerMessage1) Descriptor() ([]byte, []int) {
 const Default_EnumContainerMessage1_DefaultDuplicate1 EnumType2 = EnumType2_duplicate1
 const Default_EnumContainerMessage1_DefaultDuplicate2 EnumType2 = EnumType2_duplicate2
 
-func (m *EnumContainerMessage1) GetDefaultDuplicate1() EnumType2 {
-	if m != nil && m.DefaultDuplicate1 != nil {
-		return *m.DefaultDuplicate1
+func (x *EnumContainerMessage1) GetDefaultDuplicate1() EnumType2 {
+	if x != nil && x.DefaultDuplicate1 != nil {
+		return *x.DefaultDuplicate1
 	}
 	return Default_EnumContainerMessage1_DefaultDuplicate1
 }
 
-func (m *EnumContainerMessage1) GetDefaultDuplicate2() EnumType2 {
-	if m != nil && m.DefaultDuplicate2 != nil {
-		return *m.DefaultDuplicate2
+func (x *EnumContainerMessage1) GetDefaultDuplicate2() EnumType2 {
+	if x != nil && x.DefaultDuplicate2 != nil {
+		return *x.DefaultDuplicate2
 	}
 	return Default_EnumContainerMessage1_DefaultDuplicate2
 }
@@ -344,17 +357,20 @@ type EnumContainerMessage1_EnumContainerMessage2 struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *EnumContainerMessage1_EnumContainerMessage2) ProtoReflect() protoreflect.Message {
-	return xxx_File_proto2_enum_proto_messageTypes[1].MessageOf(m)
-}
-func (m *EnumContainerMessage1_EnumContainerMessage2) Reset() {
-	*m = EnumContainerMessage1_EnumContainerMessage2{}
+func (x *EnumContainerMessage1_EnumContainerMessage2) Reset() {
+	*x = EnumContainerMessage1_EnumContainerMessage2{}
 }
-func (m *EnumContainerMessage1_EnumContainerMessage2) String() string {
-	return protoimpl.X.MessageStringOf(m)
+
+func (x *EnumContainerMessage1_EnumContainerMessage2) String() string {
+	return protoimpl.X.MessageStringOf(x)
 }
+
 func (*EnumContainerMessage1_EnumContainerMessage2) ProtoMessage() {}
 
+func (x *EnumContainerMessage1_EnumContainerMessage2) ProtoReflect() protoreflect.Message {
+	return xxx_File_proto2_enum_proto_messageTypes[1].MessageOf(x)
+}
+
 // Deprecated: Use EnumContainerMessage1_EnumContainerMessage2.ProtoReflect.Type instead.
 func (*EnumContainerMessage1_EnumContainerMessage2) Descriptor() ([]byte, []int) {
 	return xxx_File_proto2_enum_proto_rawDescGZIP(), []int{0, 0}

Разница между файлами не показана из-за своего большого размера
+ 301 - 293
cmd/protoc-gen-go/testdata/proto2/fields.pb.go


+ 45 - 24
cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go

@@ -20,28 +20,35 @@ type Layer1 struct {
 	XXX_sizecache        int32                 `json:"-"`
 }
 
-func (m *Layer1) ProtoReflect() protoreflect.Message {
-	return xxx_File_proto2_nested_messages_proto_messageTypes[0].MessageOf(m)
+func (x *Layer1) Reset() {
+	*x = Layer1{}
+}
+
+func (x *Layer1) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Layer1) ProtoMessage() {}
+
+func (x *Layer1) ProtoReflect() protoreflect.Message {
+	return xxx_File_proto2_nested_messages_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Layer1) Reset()         { *m = Layer1{} }
-func (m *Layer1) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Layer1) ProtoMessage()    {}
 
 // Deprecated: Use Layer1.ProtoReflect.Type instead.
 func (*Layer1) Descriptor() ([]byte, []int) {
 	return xxx_File_proto2_nested_messages_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *Layer1) GetL2() *Layer1_Layer2 {
-	if m != nil {
-		return m.L2
+func (x *Layer1) GetL2() *Layer1_Layer2 {
+	if x != nil {
+		return x.L2
 	}
 	return nil
 }
 
-func (m *Layer1) GetL3() *Layer1_Layer2_Layer3 {
-	if m != nil {
-		return m.L3
+func (x *Layer1) GetL3() *Layer1_Layer2_Layer3 {
+	if x != nil {
+		return x.L3
 	}
 	return nil
 }
@@ -53,21 +60,28 @@ type Layer1_Layer2 struct {
 	XXX_sizecache        int32                 `json:"-"`
 }
 
-func (m *Layer1_Layer2) ProtoReflect() protoreflect.Message {
-	return xxx_File_proto2_nested_messages_proto_messageTypes[1].MessageOf(m)
+func (x *Layer1_Layer2) Reset() {
+	*x = Layer1_Layer2{}
+}
+
+func (x *Layer1_Layer2) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Layer1_Layer2) ProtoMessage() {}
+
+func (x *Layer1_Layer2) ProtoReflect() protoreflect.Message {
+	return xxx_File_proto2_nested_messages_proto_messageTypes[1].MessageOf(x)
 }
-func (m *Layer1_Layer2) Reset()         { *m = Layer1_Layer2{} }
-func (m *Layer1_Layer2) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Layer1_Layer2) ProtoMessage()    {}
 
 // Deprecated: Use Layer1_Layer2.ProtoReflect.Type instead.
 func (*Layer1_Layer2) Descriptor() ([]byte, []int) {
 	return xxx_File_proto2_nested_messages_proto_rawDescGZIP(), []int{0, 0}
 }
 
-func (m *Layer1_Layer2) GetL3() *Layer1_Layer2_Layer3 {
-	if m != nil {
-		return m.L3
+func (x *Layer1_Layer2) GetL3() *Layer1_Layer2_Layer3 {
+	if x != nil {
+		return x.L3
 	}
 	return nil
 }
@@ -78,12 +92,19 @@ type Layer1_Layer2_Layer3 struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Layer1_Layer2_Layer3) ProtoReflect() protoreflect.Message {
-	return xxx_File_proto2_nested_messages_proto_messageTypes[2].MessageOf(m)
+func (x *Layer1_Layer2_Layer3) Reset() {
+	*x = Layer1_Layer2_Layer3{}
+}
+
+func (x *Layer1_Layer2_Layer3) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Layer1_Layer2_Layer3) ProtoMessage() {}
+
+func (x *Layer1_Layer2_Layer3) ProtoReflect() protoreflect.Message {
+	return xxx_File_proto2_nested_messages_proto_messageTypes[2].MessageOf(x)
 }
-func (m *Layer1_Layer2_Layer3) Reset()         { *m = Layer1_Layer2_Layer3{} }
-func (m *Layer1_Layer2_Layer3) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Layer1_Layer2_Layer3) ProtoMessage()    {}
 
 // Deprecated: Use Layer1_Layer2_Layer3.ProtoReflect.Type instead.
 func (*Layer1_Layer2_Layer3) Descriptor() ([]byte, []int) {

+ 18 - 11
cmd/protoc-gen-go/testdata/proto2/proto2.pb.go

@@ -20,28 +20,35 @@ type Message struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Message) ProtoReflect() protoreflect.Message {
-	return xxx_File_proto2_proto2_proto_messageTypes[0].MessageOf(m)
+func (x *Message) Reset() {
+	*x = Message{}
+}
+
+func (x *Message) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message) ProtoMessage() {}
+
+func (x *Message) ProtoReflect() protoreflect.Message {
+	return xxx_File_proto2_proto2_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Message) Reset()         { *m = Message{} }
-func (m *Message) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message) ProtoMessage()    {}
 
 // Deprecated: Use Message.ProtoReflect.Type instead.
 func (*Message) Descriptor() ([]byte, []int) {
 	return xxx_File_proto2_proto2_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *Message) GetI32() int32 {
-	if m != nil && m.I32 != nil {
-		return *m.I32
+func (x *Message) GetI32() int32 {
+	if x != nil && x.I32 != nil {
+		return *x.I32
 	}
 	return 0
 }
 
-func (m *Message) GetM() *Message {
-	if m != nil {
-		return m.M
+func (x *Message) GetM() *Message {
+	if x != nil {
+		return x.M
 	}
 	return nil
 }

+ 8 - 7
cmd/protoc-gen-go/testdata/proto3/enum.pb.go

@@ -20,13 +20,6 @@ const (
 	Enum_TWO  Enum = 2
 )
 
-func (e Enum) Type() protoreflect.EnumType {
-	return xxx_File_proto3_enum_proto_enumTypes[0]
-}
-func (e Enum) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use Enum.Type.Values instead.
 var Enum_name = map[int32]string{
 	0: "ZERO",
@@ -45,6 +38,14 @@ func (x Enum) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (Enum) Type() protoreflect.EnumType {
+	return xxx_File_proto3_enum_proto_enumTypes[0]
+}
+
+func (x Enum) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Use Enum.Type instead.
 func (Enum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_proto3_enum_proto_rawDescGZIP(), []int{0}

+ 143 - 128
cmd/protoc-gen-go/testdata/proto3/fields.pb.go

@@ -18,13 +18,6 @@ const (
 	FieldTestMessage_ZERO FieldTestMessage_Enum = 0
 )
 
-func (e FieldTestMessage_Enum) Type() protoreflect.EnumType {
-	return xxx_File_proto3_fields_proto_enumTypes[0]
-}
-func (e FieldTestMessage_Enum) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use FieldTestMessage_Enum.Type.Values instead.
 var FieldTestMessage_Enum_name = map[int32]string{
 	0: "ZERO",
@@ -39,6 +32,14 @@ func (x FieldTestMessage_Enum) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (FieldTestMessage_Enum) Type() protoreflect.EnumType {
+	return xxx_File_proto3_fields_proto_enumTypes[0]
+}
+
+func (x FieldTestMessage_Enum) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Use FieldTestMessage_Enum.Type instead.
 func (FieldTestMessage_Enum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_proto3_fields_proto_rawDescGZIP(), []int{0, 0}
@@ -87,273 +88,280 @@ type FieldTestMessage struct {
 	XXX_sizecache        int32                                `json:"-"`
 }
 
-func (m *FieldTestMessage) ProtoReflect() protoreflect.Message {
-	return xxx_File_proto3_fields_proto_messageTypes[0].MessageOf(m)
+func (x *FieldTestMessage) Reset() {
+	*x = FieldTestMessage{}
+}
+
+func (x *FieldTestMessage) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*FieldTestMessage) ProtoMessage() {}
+
+func (x *FieldTestMessage) ProtoReflect() protoreflect.Message {
+	return xxx_File_proto3_fields_proto_messageTypes[0].MessageOf(x)
 }
-func (m *FieldTestMessage) Reset()         { *m = FieldTestMessage{} }
-func (m *FieldTestMessage) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*FieldTestMessage) ProtoMessage()    {}
 
 // Deprecated: Use FieldTestMessage.ProtoReflect.Type instead.
 func (*FieldTestMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_proto3_fields_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *FieldTestMessage) GetOptionalBool() string {
-	if m != nil {
-		return m.OptionalBool
+func (x *FieldTestMessage) GetOptionalBool() string {
+	if x != nil {
+		return x.OptionalBool
 	}
 	return ""
 }
 
-func (m *FieldTestMessage) GetOptionalEnum() FieldTestMessage_Enum {
-	if m != nil {
-		return m.OptionalEnum
+func (x *FieldTestMessage) GetOptionalEnum() FieldTestMessage_Enum {
+	if x != nil {
+		return x.OptionalEnum
 	}
 	return FieldTestMessage_ZERO
 }
 
-func (m *FieldTestMessage) GetOptionalInt32() int32 {
-	if m != nil {
-		return m.OptionalInt32
+func (x *FieldTestMessage) GetOptionalInt32() int32 {
+	if x != nil {
+		return x.OptionalInt32
 	}
 	return 0
 }
 
-func (m *FieldTestMessage) GetOptionalSint32() int32 {
-	if m != nil {
-		return m.OptionalSint32
+func (x *FieldTestMessage) GetOptionalSint32() int32 {
+	if x != nil {
+		return x.OptionalSint32
 	}
 	return 0
 }
 
-func (m *FieldTestMessage) GetOptionalUint32() uint32 {
-	if m != nil {
-		return m.OptionalUint32
+func (x *FieldTestMessage) GetOptionalUint32() uint32 {
+	if x != nil {
+		return x.OptionalUint32
 	}
 	return 0
 }
 
-func (m *FieldTestMessage) GetOptionalInt64() int64 {
-	if m != nil {
-		return m.OptionalInt64
+func (x *FieldTestMessage) GetOptionalInt64() int64 {
+	if x != nil {
+		return x.OptionalInt64
 	}
 	return 0
 }
 
-func (m *FieldTestMessage) GetOptionalSint64() int64 {
-	if m != nil {
-		return m.OptionalSint64
+func (x *FieldTestMessage) GetOptionalSint64() int64 {
+	if x != nil {
+		return x.OptionalSint64
 	}
 	return 0
 }
 
-func (m *FieldTestMessage) GetOptionalUint64() uint64 {
-	if m != nil {
-		return m.OptionalUint64
+func (x *FieldTestMessage) GetOptionalUint64() uint64 {
+	if x != nil {
+		return x.OptionalUint64
 	}
 	return 0
 }
 
-func (m *FieldTestMessage) GetOptionalSfixed32() int32 {
-	if m != nil {
-		return m.OptionalSfixed32
+func (x *FieldTestMessage) GetOptionalSfixed32() int32 {
+	if x != nil {
+		return x.OptionalSfixed32
 	}
 	return 0
 }
 
-func (m *FieldTestMessage) GetOptionalFixed32() uint32 {
-	if m != nil {
-		return m.OptionalFixed32
+func (x *FieldTestMessage) GetOptionalFixed32() uint32 {
+	if x != nil {
+		return x.OptionalFixed32
 	}
 	return 0
 }
 
-func (m *FieldTestMessage) GetOptionalFloat() float32 {
-	if m != nil {
-		return m.OptionalFloat
+func (x *FieldTestMessage) GetOptionalFloat() float32 {
+	if x != nil {
+		return x.OptionalFloat
 	}
 	return 0
 }
 
-func (m *FieldTestMessage) GetOptionalSfixed64() int64 {
-	if m != nil {
-		return m.OptionalSfixed64
+func (x *FieldTestMessage) GetOptionalSfixed64() int64 {
+	if x != nil {
+		return x.OptionalSfixed64
 	}
 	return 0
 }
 
-func (m *FieldTestMessage) GetOptionalFixed64() uint64 {
-	if m != nil {
-		return m.OptionalFixed64
+func (x *FieldTestMessage) GetOptionalFixed64() uint64 {
+	if x != nil {
+		return x.OptionalFixed64
 	}
 	return 0
 }
 
-func (m *FieldTestMessage) GetOptionalDouble() float64 {
-	if m != nil {
-		return m.OptionalDouble
+func (x *FieldTestMessage) GetOptionalDouble() float64 {
+	if x != nil {
+		return x.OptionalDouble
 	}
 	return 0
 }
 
-func (m *FieldTestMessage) GetOptionalString() string {
-	if m != nil {
-		return m.OptionalString
+func (x *FieldTestMessage) GetOptionalString() string {
+	if x != nil {
+		return x.OptionalString
 	}
 	return ""
 }
 
-func (m *FieldTestMessage) GetOptionalBytes() []byte {
-	if m != nil {
-		return m.OptionalBytes
+func (x *FieldTestMessage) GetOptionalBytes() []byte {
+	if x != nil {
+		return x.OptionalBytes
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetOptional_Message() *FieldTestMessage_Message {
-	if m != nil {
-		return m.Optional_Message
+func (x *FieldTestMessage) GetOptional_Message() *FieldTestMessage_Message {
+	if x != nil {
+		return x.Optional_Message
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeatedBool() []bool {
-	if m != nil {
-		return m.RepeatedBool
+func (x *FieldTestMessage) GetRepeatedBool() []bool {
+	if x != nil {
+		return x.RepeatedBool
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeatedEnum() []FieldTestMessage_Enum {
-	if m != nil {
-		return m.RepeatedEnum
+func (x *FieldTestMessage) GetRepeatedEnum() []FieldTestMessage_Enum {
+	if x != nil {
+		return x.RepeatedEnum
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeatedInt32() []int32 {
-	if m != nil {
-		return m.RepeatedInt32
+func (x *FieldTestMessage) GetRepeatedInt32() []int32 {
+	if x != nil {
+		return x.RepeatedInt32
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeatedSint32() []int32 {
-	if m != nil {
-		return m.RepeatedSint32
+func (x *FieldTestMessage) GetRepeatedSint32() []int32 {
+	if x != nil {
+		return x.RepeatedSint32
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeatedUint32() []uint32 {
-	if m != nil {
-		return m.RepeatedUint32
+func (x *FieldTestMessage) GetRepeatedUint32() []uint32 {
+	if x != nil {
+		return x.RepeatedUint32
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeatedInt64() []int64 {
-	if m != nil {
-		return m.RepeatedInt64
+func (x *FieldTestMessage) GetRepeatedInt64() []int64 {
+	if x != nil {
+		return x.RepeatedInt64
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeatedSint64() []int64 {
-	if m != nil {
-		return m.RepeatedSint64
+func (x *FieldTestMessage) GetRepeatedSint64() []int64 {
+	if x != nil {
+		return x.RepeatedSint64
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeatedUint64() []uint64 {
-	if m != nil {
-		return m.RepeatedUint64
+func (x *FieldTestMessage) GetRepeatedUint64() []uint64 {
+	if x != nil {
+		return x.RepeatedUint64
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeatedSfixed32() []int32 {
-	if m != nil {
-		return m.RepeatedSfixed32
+func (x *FieldTestMessage) GetRepeatedSfixed32() []int32 {
+	if x != nil {
+		return x.RepeatedSfixed32
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeatedFixed32() []uint32 {
-	if m != nil {
-		return m.RepeatedFixed32
+func (x *FieldTestMessage) GetRepeatedFixed32() []uint32 {
+	if x != nil {
+		return x.RepeatedFixed32
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeatedFloat() []float32 {
-	if m != nil {
-		return m.RepeatedFloat
+func (x *FieldTestMessage) GetRepeatedFloat() []float32 {
+	if x != nil {
+		return x.RepeatedFloat
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeatedSfixed64() []int64 {
-	if m != nil {
-		return m.RepeatedSfixed64
+func (x *FieldTestMessage) GetRepeatedSfixed64() []int64 {
+	if x != nil {
+		return x.RepeatedSfixed64
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeatedFixed64() []uint64 {
-	if m != nil {
-		return m.RepeatedFixed64
+func (x *FieldTestMessage) GetRepeatedFixed64() []uint64 {
+	if x != nil {
+		return x.RepeatedFixed64
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeatedDouble() []float64 {
-	if m != nil {
-		return m.RepeatedDouble
+func (x *FieldTestMessage) GetRepeatedDouble() []float64 {
+	if x != nil {
+		return x.RepeatedDouble
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeatedString() []string {
-	if m != nil {
-		return m.RepeatedString
+func (x *FieldTestMessage) GetRepeatedString() []string {
+	if x != nil {
+		return x.RepeatedString
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeatedBytes() [][]byte {
-	if m != nil {
-		return m.RepeatedBytes
+func (x *FieldTestMessage) GetRepeatedBytes() [][]byte {
+	if x != nil {
+		return x.RepeatedBytes
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetRepeated_Message() []*FieldTestMessage_Message {
-	if m != nil {
-		return m.Repeated_Message
+func (x *FieldTestMessage) GetRepeated_Message() []*FieldTestMessage_Message {
+	if x != nil {
+		return x.Repeated_Message
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetMapInt32Int64() map[int32]int64 {
-	if m != nil {
-		return m.MapInt32Int64
+func (x *FieldTestMessage) GetMapInt32Int64() map[int32]int64 {
+	if x != nil {
+		return x.MapInt32Int64
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetMapStringMessage() map[string]*FieldTestMessage_Message {
-	if m != nil {
-		return m.MapStringMessage
+func (x *FieldTestMessage) GetMapStringMessage() map[string]*FieldTestMessage_Message {
+	if x != nil {
+		return x.MapStringMessage
 	}
 	return nil
 }
 
-func (m *FieldTestMessage) GetMapFixed64Enum() map[uint64]FieldTestMessage_Enum {
-	if m != nil {
-		return m.MapFixed64Enum
+func (x *FieldTestMessage) GetMapFixed64Enum() map[uint64]FieldTestMessage_Enum {
+	if x != nil {
+		return x.MapFixed64Enum
 	}
 	return nil
 }
@@ -364,12 +372,19 @@ type FieldTestMessage_Message struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *FieldTestMessage_Message) ProtoReflect() protoreflect.Message {
-	return xxx_File_proto3_fields_proto_messageTypes[4].MessageOf(m)
+func (x *FieldTestMessage_Message) Reset() {
+	*x = FieldTestMessage_Message{}
+}
+
+func (x *FieldTestMessage_Message) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*FieldTestMessage_Message) ProtoMessage() {}
+
+func (x *FieldTestMessage_Message) ProtoReflect() protoreflect.Message {
+	return xxx_File_proto3_fields_proto_messageTypes[4].MessageOf(x)
 }
-func (m *FieldTestMessage_Message) Reset()         { *m = FieldTestMessage_Message{} }
-func (m *FieldTestMessage_Message) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*FieldTestMessage_Message) ProtoMessage()    {}
 
 // Deprecated: Use FieldTestMessage_Message.ProtoReflect.Type instead.
 func (*FieldTestMessage_Message) Descriptor() ([]byte, []int) {

Разница между файлами не показана из-за своего большого размера
+ 414 - 300
encoding/testprotos/pb2/test.pb.go


+ 184 - 133
encoding/testprotos/pb3/test.pb.go

@@ -21,13 +21,6 @@ const (
 	Enum_TEN  Enum = 10
 )
 
-func (e Enum) Type() protoreflect.EnumType {
-	return xxx_File_pb3_test_proto_enumTypes[0]
-}
-func (e Enum) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use Enum.Type.Values instead.
 var Enum_name = map[int32]string{
 	0:  "ZERO",
@@ -48,6 +41,14 @@ func (x Enum) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (Enum) Type() protoreflect.EnumType {
+	return xxx_File_pb3_test_proto_enumTypes[0]
+}
+
+func (x Enum) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Use Enum.Type instead.
 func (Enum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawDescGZIP(), []int{0}
@@ -62,13 +63,6 @@ const (
 	Enums_DIEZ Enums_NestedEnum = 10
 )
 
-func (e Enums_NestedEnum) Type() protoreflect.EnumType {
-	return xxx_File_pb3_test_proto_enumTypes[1]
-}
-func (e Enums_NestedEnum) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use Enums_NestedEnum.Type.Values instead.
 var Enums_NestedEnum_name = map[int32]string{
 	0:  "CERO",
@@ -89,6 +83,14 @@ func (x Enums_NestedEnum) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (Enums_NestedEnum) Type() protoreflect.EnumType {
+	return xxx_File_pb3_test_proto_enumTypes[1]
+}
+
+func (x Enums_NestedEnum) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Use Enums_NestedEnum.Type instead.
 func (Enums_NestedEnum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawDescGZIP(), []int{1, 0}
@@ -116,119 +118,126 @@ type Scalars struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Scalars) ProtoReflect() protoreflect.Message {
-	return xxx_File_pb3_test_proto_messageTypes[0].MessageOf(m)
+func (x *Scalars) Reset() {
+	*x = Scalars{}
+}
+
+func (x *Scalars) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Scalars) ProtoMessage() {}
+
+func (x *Scalars) ProtoReflect() protoreflect.Message {
+	return xxx_File_pb3_test_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Scalars) Reset()         { *m = Scalars{} }
-func (m *Scalars) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Scalars) ProtoMessage()    {}
 
 // Deprecated: Use Scalars.ProtoReflect.Type instead.
 func (*Scalars) Descriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *Scalars) GetSBool() bool {
-	if m != nil {
-		return m.SBool
+func (x *Scalars) GetSBool() bool {
+	if x != nil {
+		return x.SBool
 	}
 	return false
 }
 
-func (m *Scalars) GetSInt32() int32 {
-	if m != nil {
-		return m.SInt32
+func (x *Scalars) GetSInt32() int32 {
+	if x != nil {
+		return x.SInt32
 	}
 	return 0
 }
 
-func (m *Scalars) GetSInt64() int64 {
-	if m != nil {
-		return m.SInt64
+func (x *Scalars) GetSInt64() int64 {
+	if x != nil {
+		return x.SInt64
 	}
 	return 0
 }
 
-func (m *Scalars) GetSUint32() uint32 {
-	if m != nil {
-		return m.SUint32
+func (x *Scalars) GetSUint32() uint32 {
+	if x != nil {
+		return x.SUint32
 	}
 	return 0
 }
 
-func (m *Scalars) GetSUint64() uint64 {
-	if m != nil {
-		return m.SUint64
+func (x *Scalars) GetSUint64() uint64 {
+	if x != nil {
+		return x.SUint64
 	}
 	return 0
 }
 
-func (m *Scalars) GetSSint32() int32 {
-	if m != nil {
-		return m.SSint32
+func (x *Scalars) GetSSint32() int32 {
+	if x != nil {
+		return x.SSint32
 	}
 	return 0
 }
 
-func (m *Scalars) GetSSint64() int64 {
-	if m != nil {
-		return m.SSint64
+func (x *Scalars) GetSSint64() int64 {
+	if x != nil {
+		return x.SSint64
 	}
 	return 0
 }
 
-func (m *Scalars) GetSFixed32() uint32 {
-	if m != nil {
-		return m.SFixed32
+func (x *Scalars) GetSFixed32() uint32 {
+	if x != nil {
+		return x.SFixed32
 	}
 	return 0
 }
 
-func (m *Scalars) GetSFixed64() uint64 {
-	if m != nil {
-		return m.SFixed64
+func (x *Scalars) GetSFixed64() uint64 {
+	if x != nil {
+		return x.SFixed64
 	}
 	return 0
 }
 
-func (m *Scalars) GetSSfixed32() int32 {
-	if m != nil {
-		return m.SSfixed32
+func (x *Scalars) GetSSfixed32() int32 {
+	if x != nil {
+		return x.SSfixed32
 	}
 	return 0
 }
 
-func (m *Scalars) GetSSfixed64() int64 {
-	if m != nil {
-		return m.SSfixed64
+func (x *Scalars) GetSSfixed64() int64 {
+	if x != nil {
+		return x.SSfixed64
 	}
 	return 0
 }
 
-func (m *Scalars) GetSFloat() float32 {
-	if m != nil {
-		return m.SFloat
+func (x *Scalars) GetSFloat() float32 {
+	if x != nil {
+		return x.SFloat
 	}
 	return 0
 }
 
-func (m *Scalars) GetSDouble() float64 {
-	if m != nil {
-		return m.SDouble
+func (x *Scalars) GetSDouble() float64 {
+	if x != nil {
+		return x.SDouble
 	}
 	return 0
 }
 
-func (m *Scalars) GetSBytes() []byte {
-	if m != nil {
-		return m.SBytes
+func (x *Scalars) GetSBytes() []byte {
+	if x != nil {
+		return x.SBytes
 	}
 	return nil
 }
 
-func (m *Scalars) GetSString() string {
-	if m != nil {
-		return m.SString
+func (x *Scalars) GetSString() string {
+	if x != nil {
+		return x.SString
 	}
 	return ""
 }
@@ -242,28 +251,35 @@ type Enums struct {
 	XXX_sizecache        int32            `json:"-"`
 }
 
-func (m *Enums) ProtoReflect() protoreflect.Message {
-	return xxx_File_pb3_test_proto_messageTypes[1].MessageOf(m)
+func (x *Enums) Reset() {
+	*x = Enums{}
+}
+
+func (x *Enums) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Enums) ProtoMessage() {}
+
+func (x *Enums) ProtoReflect() protoreflect.Message {
+	return xxx_File_pb3_test_proto_messageTypes[1].MessageOf(x)
 }
-func (m *Enums) Reset()         { *m = Enums{} }
-func (m *Enums) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Enums) ProtoMessage()    {}
 
 // Deprecated: Use Enums.ProtoReflect.Type instead.
 func (*Enums) Descriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawDescGZIP(), []int{1}
 }
 
-func (m *Enums) GetSEnum() Enum {
-	if m != nil {
-		return m.SEnum
+func (x *Enums) GetSEnum() Enum {
+	if x != nil {
+		return x.SEnum
 	}
 	return Enum_ZERO
 }
 
-func (m *Enums) GetSNestedEnum() Enums_NestedEnum {
-	if m != nil {
-		return m.SNestedEnum
+func (x *Enums) GetSNestedEnum() Enums_NestedEnum {
+	if x != nil {
+		return x.SNestedEnum
 	}
 	return Enums_CERO
 }
@@ -276,21 +292,28 @@ type Nests struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Nests) ProtoReflect() protoreflect.Message {
-	return xxx_File_pb3_test_proto_messageTypes[2].MessageOf(m)
+func (x *Nests) Reset() {
+	*x = Nests{}
+}
+
+func (x *Nests) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Nests) ProtoMessage() {}
+
+func (x *Nests) ProtoReflect() protoreflect.Message {
+	return xxx_File_pb3_test_proto_messageTypes[2].MessageOf(x)
 }
-func (m *Nests) Reset()         { *m = Nests{} }
-func (m *Nests) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Nests) ProtoMessage()    {}
 
 // Deprecated: Use Nests.ProtoReflect.Type instead.
 func (*Nests) Descriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawDescGZIP(), []int{2}
 }
 
-func (m *Nests) GetSNested() *Nested {
-	if m != nil {
-		return m.SNested
+func (x *Nests) GetSNested() *Nested {
+	if x != nil {
+		return x.SNested
 	}
 	return nil
 }
@@ -304,28 +327,35 @@ type Nested struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Nested) ProtoReflect() protoreflect.Message {
-	return xxx_File_pb3_test_proto_messageTypes[3].MessageOf(m)
+func (x *Nested) Reset() {
+	*x = Nested{}
+}
+
+func (x *Nested) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Nested) ProtoMessage() {}
+
+func (x *Nested) ProtoReflect() protoreflect.Message {
+	return xxx_File_pb3_test_proto_messageTypes[3].MessageOf(x)
 }
-func (m *Nested) Reset()         { *m = Nested{} }
-func (m *Nested) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Nested) ProtoMessage()    {}
 
 // Deprecated: Use Nested.ProtoReflect.Type instead.
 func (*Nested) Descriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawDescGZIP(), []int{3}
 }
 
-func (m *Nested) GetSString() string {
-	if m != nil {
-		return m.SString
+func (x *Nested) GetSString() string {
+	if x != nil {
+		return x.SString
 	}
 	return ""
 }
 
-func (m *Nested) GetSNested() *Nested {
-	if m != nil {
-		return m.SNested
+func (x *Nested) GetSNested() *Nested {
+	if x != nil {
+		return x.SNested
 	}
 	return nil
 }
@@ -342,12 +372,19 @@ type Oneofs struct {
 	XXX_sizecache        int32          `json:"-"`
 }
 
-func (m *Oneofs) ProtoReflect() protoreflect.Message {
-	return xxx_File_pb3_test_proto_messageTypes[4].MessageOf(m)
+func (x *Oneofs) Reset() {
+	*x = Oneofs{}
+}
+
+func (x *Oneofs) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Oneofs) ProtoMessage() {}
+
+func (x *Oneofs) ProtoReflect() protoreflect.Message {
+	return xxx_File_pb3_test_proto_messageTypes[4].MessageOf(x)
 }
-func (m *Oneofs) Reset()         { *m = Oneofs{} }
-func (m *Oneofs) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Oneofs) ProtoMessage()    {}
 
 // Deprecated: Use Oneofs.ProtoReflect.Type instead.
 func (*Oneofs) Descriptor() ([]byte, []int) {
@@ -383,22 +420,22 @@ func (m *Oneofs) GetUnion() isOneofs_Union {
 	return nil
 }
 
-func (m *Oneofs) GetOneofEnum() Enum {
-	if x, ok := m.GetUnion().(*Oneofs_OneofEnum); ok {
+func (x *Oneofs) GetOneofEnum() Enum {
+	if x, ok := x.GetUnion().(*Oneofs_OneofEnum); ok {
 		return x.OneofEnum
 	}
 	return Enum_ZERO
 }
 
-func (m *Oneofs) GetOneofString() string {
-	if x, ok := m.GetUnion().(*Oneofs_OneofString); ok {
+func (x *Oneofs) GetOneofString() string {
+	if x, ok := x.GetUnion().(*Oneofs_OneofString); ok {
 		return x.OneofString
 	}
 	return ""
 }
 
-func (m *Oneofs) GetOneofNested() *Nested {
-	if x, ok := m.GetUnion().(*Oneofs_OneofNested); ok {
+func (x *Oneofs) GetOneofNested() *Nested {
+	if x, ok := x.GetUnion().(*Oneofs_OneofNested); ok {
 		return x.OneofNested
 	}
 	return nil
@@ -425,49 +462,56 @@ type Maps struct {
 	XXX_sizecache        int32              `json:"-"`
 }
 
-func (m *Maps) ProtoReflect() protoreflect.Message {
-	return xxx_File_pb3_test_proto_messageTypes[5].MessageOf(m)
+func (x *Maps) Reset() {
+	*x = Maps{}
+}
+
+func (x *Maps) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Maps) ProtoMessage() {}
+
+func (x *Maps) ProtoReflect() protoreflect.Message {
+	return xxx_File_pb3_test_proto_messageTypes[5].MessageOf(x)
 }
-func (m *Maps) Reset()         { *m = Maps{} }
-func (m *Maps) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Maps) ProtoMessage()    {}
 
 // Deprecated: Use Maps.ProtoReflect.Type instead.
 func (*Maps) Descriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawDescGZIP(), []int{5}
 }
 
-func (m *Maps) GetInt32ToStr() map[int32]string {
-	if m != nil {
-		return m.Int32ToStr
+func (x *Maps) GetInt32ToStr() map[int32]string {
+	if x != nil {
+		return x.Int32ToStr
 	}
 	return nil
 }
 
-func (m *Maps) GetBoolToUint32() map[bool]uint32 {
-	if m != nil {
-		return m.BoolToUint32
+func (x *Maps) GetBoolToUint32() map[bool]uint32 {
+	if x != nil {
+		return x.BoolToUint32
 	}
 	return nil
 }
 
-func (m *Maps) GetUint64ToEnum() map[uint64]Enum {
-	if m != nil {
-		return m.Uint64ToEnum
+func (x *Maps) GetUint64ToEnum() map[uint64]Enum {
+	if x != nil {
+		return x.Uint64ToEnum
 	}
 	return nil
 }
 
-func (m *Maps) GetStrToNested() map[string]*Nested {
-	if m != nil {
-		return m.StrToNested
+func (x *Maps) GetStrToNested() map[string]*Nested {
+	if x != nil {
+		return x.StrToNested
 	}
 	return nil
 }
 
-func (m *Maps) GetStrToOneofs() map[string]*Oneofs {
-	if m != nil {
-		return m.StrToOneofs
+func (x *Maps) GetStrToOneofs() map[string]*Oneofs {
+	if x != nil {
+		return x.StrToOneofs
 	}
 	return nil
 }
@@ -480,21 +524,28 @@ type JSONNames struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *JSONNames) ProtoReflect() protoreflect.Message {
-	return xxx_File_pb3_test_proto_messageTypes[6].MessageOf(m)
+func (x *JSONNames) Reset() {
+	*x = JSONNames{}
+}
+
+func (x *JSONNames) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*JSONNames) ProtoMessage() {}
+
+func (x *JSONNames) ProtoReflect() protoreflect.Message {
+	return xxx_File_pb3_test_proto_messageTypes[6].MessageOf(x)
 }
-func (m *JSONNames) Reset()         { *m = JSONNames{} }
-func (m *JSONNames) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*JSONNames) ProtoMessage()    {}
 
 // Deprecated: Use JSONNames.ProtoReflect.Type instead.
 func (*JSONNames) Descriptor() ([]byte, []int) {
 	return xxx_File_pb3_test_proto_rawDescGZIP(), []int{6}
 }
 
-func (m *JSONNames) GetSString() string {
-	if m != nil {
-		return m.SString
+func (x *JSONNames) GetSString() string {
+	if x != nil {
+		return x.SString
 	}
 	return ""
 }

+ 106 - 76
internal/testprotos/conformance/conformance.pb.go

@@ -22,13 +22,6 @@ const (
 	WireFormat_TEXT_FORMAT WireFormat = 4
 )
 
-func (e WireFormat) Type() protoreflect.EnumType {
-	return xxx_File_conformance_conformance_proto_enumTypes[0]
-}
-func (e WireFormat) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use WireFormat.Type.Values instead.
 var WireFormat_name = map[int32]string{
 	0: "UNSPECIFIED",
@@ -51,6 +44,14 @@ func (x WireFormat) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (WireFormat) Type() protoreflect.EnumType {
+	return xxx_File_conformance_conformance_proto_enumTypes[0]
+}
+
+func (x WireFormat) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Use WireFormat.Type instead.
 func (WireFormat) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_conformance_conformance_proto_rawDescGZIP(), []int{0}
@@ -75,13 +76,6 @@ const (
 	TestCategory_TEXT_FORMAT_TEST TestCategory = 5
 )
 
-func (e TestCategory) Type() protoreflect.EnumType {
-	return xxx_File_conformance_conformance_proto_enumTypes[1]
-}
-func (e TestCategory) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use TestCategory.Type.Values instead.
 var TestCategory_name = map[int32]string{
 	0: "UNSPECIFIED_TEST",
@@ -106,6 +100,14 @@ func (x TestCategory) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (TestCategory) Type() protoreflect.EnumType {
+	return xxx_File_conformance_conformance_proto_enumTypes[1]
+}
+
+func (x TestCategory) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Use TestCategory.Type instead.
 func (TestCategory) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_conformance_conformance_proto_rawDescGZIP(), []int{1}
@@ -121,21 +123,28 @@ type FailureSet struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *FailureSet) ProtoReflect() protoreflect.Message {
-	return xxx_File_conformance_conformance_proto_messageTypes[0].MessageOf(m)
+func (x *FailureSet) Reset() {
+	*x = FailureSet{}
+}
+
+func (x *FailureSet) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*FailureSet) ProtoMessage() {}
+
+func (x *FailureSet) ProtoReflect() protoreflect.Message {
+	return xxx_File_conformance_conformance_proto_messageTypes[0].MessageOf(x)
 }
-func (m *FailureSet) Reset()         { *m = FailureSet{} }
-func (m *FailureSet) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*FailureSet) ProtoMessage()    {}
 
 // Deprecated: Use FailureSet.ProtoReflect.Type instead.
 func (*FailureSet) Descriptor() ([]byte, []int) {
 	return xxx_File_conformance_conformance_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *FailureSet) GetFailure() []string {
-	if m != nil {
-		return m.Failure
+func (x *FailureSet) GetFailure() []string {
+	if x != nil {
+		return x.Failure
 	}
 	return nil
 }
@@ -178,12 +187,19 @@ type ConformanceRequest struct {
 	XXX_sizecache        int32               `json:"-"`
 }
 
-func (m *ConformanceRequest) ProtoReflect() protoreflect.Message {
-	return xxx_File_conformance_conformance_proto_messageTypes[1].MessageOf(m)
+func (x *ConformanceRequest) Reset() {
+	*x = ConformanceRequest{}
+}
+
+func (x *ConformanceRequest) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ConformanceRequest) ProtoMessage() {}
+
+func (x *ConformanceRequest) ProtoReflect() protoreflect.Message {
+	return xxx_File_conformance_conformance_proto_messageTypes[1].MessageOf(x)
 }
-func (m *ConformanceRequest) Reset()         { *m = ConformanceRequest{} }
-func (m *ConformanceRequest) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*ConformanceRequest) ProtoMessage()    {}
 
 // Deprecated: Use ConformanceRequest.ProtoReflect.Type instead.
 func (*ConformanceRequest) Descriptor() ([]byte, []int) {
@@ -225,58 +241,58 @@ func (m *ConformanceRequest) GetPayload() isConformanceRequest_Payload {
 	return nil
 }
 
-func (m *ConformanceRequest) GetProtobufPayload() []byte {
-	if x, ok := m.GetPayload().(*ConformanceRequest_ProtobufPayload); ok {
+func (x *ConformanceRequest) GetProtobufPayload() []byte {
+	if x, ok := x.GetPayload().(*ConformanceRequest_ProtobufPayload); ok {
 		return x.ProtobufPayload
 	}
 	return nil
 }
 
-func (m *ConformanceRequest) GetJsonPayload() string {
-	if x, ok := m.GetPayload().(*ConformanceRequest_JsonPayload); ok {
+func (x *ConformanceRequest) GetJsonPayload() string {
+	if x, ok := x.GetPayload().(*ConformanceRequest_JsonPayload); ok {
 		return x.JsonPayload
 	}
 	return ""
 }
 
-func (m *ConformanceRequest) GetJspbPayload() string {
-	if x, ok := m.GetPayload().(*ConformanceRequest_JspbPayload); ok {
+func (x *ConformanceRequest) GetJspbPayload() string {
+	if x, ok := x.GetPayload().(*ConformanceRequest_JspbPayload); ok {
 		return x.JspbPayload
 	}
 	return ""
 }
 
-func (m *ConformanceRequest) GetTextPayload() string {
-	if x, ok := m.GetPayload().(*ConformanceRequest_TextPayload); ok {
+func (x *ConformanceRequest) GetTextPayload() string {
+	if x, ok := x.GetPayload().(*ConformanceRequest_TextPayload); ok {
 		return x.TextPayload
 	}
 	return ""
 }
 
-func (m *ConformanceRequest) GetRequestedOutputFormat() WireFormat {
-	if m != nil {
-		return m.RequestedOutputFormat
+func (x *ConformanceRequest) GetRequestedOutputFormat() WireFormat {
+	if x != nil {
+		return x.RequestedOutputFormat
 	}
 	return WireFormat_UNSPECIFIED
 }
 
-func (m *ConformanceRequest) GetMessageType() string {
-	if m != nil {
-		return m.MessageType
+func (x *ConformanceRequest) GetMessageType() string {
+	if x != nil {
+		return x.MessageType
 	}
 	return ""
 }
 
-func (m *ConformanceRequest) GetTestCategory() TestCategory {
-	if m != nil {
-		return m.TestCategory
+func (x *ConformanceRequest) GetTestCategory() TestCategory {
+	if x != nil {
+		return x.TestCategory
 	}
 	return TestCategory_UNSPECIFIED_TEST
 }
 
-func (m *ConformanceRequest) GetJspbEncodingOptions() *JspbEncodingConfig {
-	if m != nil {
-		return m.JspbEncodingOptions
+func (x *ConformanceRequest) GetJspbEncodingOptions() *JspbEncodingConfig {
+	if x != nil {
+		return x.JspbEncodingOptions
 	}
 	return nil
 }
@@ -330,12 +346,19 @@ type ConformanceResponse struct {
 	XXX_sizecache        int32                        `json:"-"`
 }
 
-func (m *ConformanceResponse) ProtoReflect() protoreflect.Message {
-	return xxx_File_conformance_conformance_proto_messageTypes[2].MessageOf(m)
+func (x *ConformanceResponse) Reset() {
+	*x = ConformanceResponse{}
+}
+
+func (x *ConformanceResponse) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ConformanceResponse) ProtoMessage() {}
+
+func (x *ConformanceResponse) ProtoReflect() protoreflect.Message {
+	return xxx_File_conformance_conformance_proto_messageTypes[2].MessageOf(x)
 }
-func (m *ConformanceResponse) Reset()         { *m = ConformanceResponse{} }
-func (m *ConformanceResponse) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*ConformanceResponse) ProtoMessage()    {}
 
 // Deprecated: Use ConformanceResponse.ProtoReflect.Type instead.
 func (*ConformanceResponse) Descriptor() ([]byte, []int) {
@@ -401,57 +424,57 @@ func (m *ConformanceResponse) GetResult() isConformanceResponse_Result {
 	return nil
 }
 
-func (m *ConformanceResponse) GetParseError() string {
-	if x, ok := m.GetResult().(*ConformanceResponse_ParseError); ok {
+func (x *ConformanceResponse) GetParseError() string {
+	if x, ok := x.GetResult().(*ConformanceResponse_ParseError); ok {
 		return x.ParseError
 	}
 	return ""
 }
 
-func (m *ConformanceResponse) GetSerializeError() string {
-	if x, ok := m.GetResult().(*ConformanceResponse_SerializeError); ok {
+func (x *ConformanceResponse) GetSerializeError() string {
+	if x, ok := x.GetResult().(*ConformanceResponse_SerializeError); ok {
 		return x.SerializeError
 	}
 	return ""
 }
 
-func (m *ConformanceResponse) GetRuntimeError() string {
-	if x, ok := m.GetResult().(*ConformanceResponse_RuntimeError); ok {
+func (x *ConformanceResponse) GetRuntimeError() string {
+	if x, ok := x.GetResult().(*ConformanceResponse_RuntimeError); ok {
 		return x.RuntimeError
 	}
 	return ""
 }
 
-func (m *ConformanceResponse) GetProtobufPayload() []byte {
-	if x, ok := m.GetResult().(*ConformanceResponse_ProtobufPayload); ok {
+func (x *ConformanceResponse) GetProtobufPayload() []byte {
+	if x, ok := x.GetResult().(*ConformanceResponse_ProtobufPayload); ok {
 		return x.ProtobufPayload
 	}
 	return nil
 }
 
-func (m *ConformanceResponse) GetJsonPayload() string {
-	if x, ok := m.GetResult().(*ConformanceResponse_JsonPayload); ok {
+func (x *ConformanceResponse) GetJsonPayload() string {
+	if x, ok := x.GetResult().(*ConformanceResponse_JsonPayload); ok {
 		return x.JsonPayload
 	}
 	return ""
 }
 
-func (m *ConformanceResponse) GetSkipped() string {
-	if x, ok := m.GetResult().(*ConformanceResponse_Skipped); ok {
+func (x *ConformanceResponse) GetSkipped() string {
+	if x, ok := x.GetResult().(*ConformanceResponse_Skipped); ok {
 		return x.Skipped
 	}
 	return ""
 }
 
-func (m *ConformanceResponse) GetJspbPayload() string {
-	if x, ok := m.GetResult().(*ConformanceResponse_JspbPayload); ok {
+func (x *ConformanceResponse) GetJspbPayload() string {
+	if x, ok := x.GetResult().(*ConformanceResponse_JspbPayload); ok {
 		return x.JspbPayload
 	}
 	return ""
 }
 
-func (m *ConformanceResponse) GetTextPayload() string {
-	if x, ok := m.GetResult().(*ConformanceResponse_TextPayload); ok {
+func (x *ConformanceResponse) GetTextPayload() string {
+	if x, ok := x.GetResult().(*ConformanceResponse_TextPayload); ok {
 		return x.TextPayload
 	}
 	return ""
@@ -480,21 +503,28 @@ type JspbEncodingConfig struct {
 	XXX_sizecache         int32    `json:"-"`
 }
 
-func (m *JspbEncodingConfig) ProtoReflect() protoreflect.Message {
-	return xxx_File_conformance_conformance_proto_messageTypes[3].MessageOf(m)
+func (x *JspbEncodingConfig) Reset() {
+	*x = JspbEncodingConfig{}
+}
+
+func (x *JspbEncodingConfig) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*JspbEncodingConfig) ProtoMessage() {}
+
+func (x *JspbEncodingConfig) ProtoReflect() protoreflect.Message {
+	return xxx_File_conformance_conformance_proto_messageTypes[3].MessageOf(x)
 }
-func (m *JspbEncodingConfig) Reset()         { *m = JspbEncodingConfig{} }
-func (m *JspbEncodingConfig) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*JspbEncodingConfig) ProtoMessage()    {}
 
 // Deprecated: Use JspbEncodingConfig.ProtoReflect.Type instead.
 func (*JspbEncodingConfig) Descriptor() ([]byte, []int) {
 	return xxx_File_conformance_conformance_proto_rawDescGZIP(), []int{3}
 }
 
-func (m *JspbEncodingConfig) GetUseJspbArrayAnyFormat() bool {
-	if m != nil {
-		return m.UseJspbArrayAnyFormat
+func (x *JspbEncodingConfig) GetUseJspbArrayAnyFormat() bool {
+	if x != nil {
+		return x.UseJspbArrayAnyFormat
 	}
 	return false
 }

+ 48 - 41
internal/testprotos/legacy/legacy.pb.go

@@ -42,98 +42,105 @@ type Legacy struct {
 	XXX_sizecache        int32                 `json:"-"`
 }
 
-func (m *Legacy) ProtoReflect() protoreflect.Message {
-	return xxx_File_legacy_legacy_proto_messageTypes[0].MessageOf(m)
+func (x *Legacy) Reset() {
+	*x = Legacy{}
+}
+
+func (x *Legacy) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Legacy) ProtoMessage() {}
+
+func (x *Legacy) ProtoReflect() protoreflect.Message {
+	return xxx_File_legacy_legacy_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Legacy) Reset()         { *m = Legacy{} }
-func (m *Legacy) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Legacy) ProtoMessage()    {}
 
 // Deprecated: Use Legacy.ProtoReflect.Type instead.
 func (*Legacy) Descriptor() ([]byte, []int) {
 	return xxx_File_legacy_legacy_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *Legacy) GetF1() *proto2_v0_0.Message {
-	if m != nil {
-		return m.F1
+func (x *Legacy) GetF1() *proto2_v0_0.Message {
+	if x != nil {
+		return x.F1
 	}
 	return nil
 }
 
-func (m *Legacy) GetF2() *proto3_v0_0.Message {
-	if m != nil {
-		return m.F2
+func (x *Legacy) GetF2() *proto3_v0_0.Message {
+	if x != nil {
+		return x.F2
 	}
 	return nil
 }
 
-func (m *Legacy) GetF3() *proto2_v0_01.Message {
-	if m != nil {
-		return m.F3
+func (x *Legacy) GetF3() *proto2_v0_01.Message {
+	if x != nil {
+		return x.F3
 	}
 	return nil
 }
 
-func (m *Legacy) GetF4() *proto3_v0_01.Message {
-	if m != nil {
-		return m.F4
+func (x *Legacy) GetF4() *proto3_v0_01.Message {
+	if x != nil {
+		return x.F4
 	}
 	return nil
 }
 
-func (m *Legacy) GetF5() *proto2_v1_0.Message {
-	if m != nil {
-		return m.F5
+func (x *Legacy) GetF5() *proto2_v1_0.Message {
+	if x != nil {
+		return x.F5
 	}
 	return nil
 }
 
-func (m *Legacy) GetF6() *proto3_v1_0.Message {
-	if m != nil {
-		return m.F6
+func (x *Legacy) GetF6() *proto3_v1_0.Message {
+	if x != nil {
+		return x.F6
 	}
 	return nil
 }
 
-func (m *Legacy) GetF7() *proto2_v1_1.Message {
-	if m != nil {
-		return m.F7
+func (x *Legacy) GetF7() *proto2_v1_1.Message {
+	if x != nil {
+		return x.F7
 	}
 	return nil
 }
 
-func (m *Legacy) GetF8() *proto3_v1_1.Message {
-	if m != nil {
-		return m.F8
+func (x *Legacy) GetF8() *proto3_v1_1.Message {
+	if x != nil {
+		return x.F8
 	}
 	return nil
 }
 
-func (m *Legacy) GetF9() *proto2_v1_2.Message {
-	if m != nil {
-		return m.F9
+func (x *Legacy) GetF9() *proto2_v1_2.Message {
+	if x != nil {
+		return x.F9
 	}
 	return nil
 }
 
-func (m *Legacy) GetF10() *proto3_v1_2.Message {
-	if m != nil {
-		return m.F10
+func (x *Legacy) GetF10() *proto3_v1_2.Message {
+	if x != nil {
+		return x.F10
 	}
 	return nil
 }
 
-func (m *Legacy) GetF11() *proto2_v1_21.Message {
-	if m != nil {
-		return m.F11
+func (x *Legacy) GetF11() *proto2_v1_21.Message {
+	if x != nil {
+		return x.F11
 	}
 	return nil
 }
 
-func (m *Legacy) GetF12() *proto3_v1_21.Message {
-	if m != nil {
-		return m.F12
+func (x *Legacy) GetF12() *proto3_v1_21.Message {
+	if x != nil {
+		return x.F12
 	}
 	return nil
 }

Разница между файлами не показана из-за своего большого размера
+ 296 - 285
internal/testprotos/test/test.pb.go


+ 20 - 12
internal/testprotos/test/test_import.pb.go

@@ -18,13 +18,6 @@ const (
 	ImportEnum_IMPORT_ZERO ImportEnum = 0
 )
 
-func (e ImportEnum) Type() protoreflect.EnumType {
-	return xxx_File_test_test_import_proto_enumTypes[0]
-}
-func (e ImportEnum) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use ImportEnum.Type.Values instead.
 var ImportEnum_name = map[int32]string{
 	0: "IMPORT_ZERO",
@@ -43,6 +36,14 @@ func (x ImportEnum) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (ImportEnum) Type() protoreflect.EnumType {
+	return xxx_File_test_test_import_proto_enumTypes[0]
+}
+
+func (x ImportEnum) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Do not use.
 func (x *ImportEnum) UnmarshalJSON(b []byte) error {
 	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
@@ -64,12 +65,19 @@ type ImportMessage struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *ImportMessage) ProtoReflect() protoreflect.Message {
-	return xxx_File_test_test_import_proto_messageTypes[0].MessageOf(m)
+func (x *ImportMessage) Reset() {
+	*x = ImportMessage{}
+}
+
+func (x *ImportMessage) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ImportMessage) ProtoMessage() {}
+
+func (x *ImportMessage) ProtoReflect() protoreflect.Message {
+	return xxx_File_test_test_import_proto_messageTypes[0].MessageOf(x)
 }
-func (m *ImportMessage) Reset()         { *m = ImportMessage{} }
-func (m *ImportMessage) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*ImportMessage) ProtoMessage()    {}
 
 // Deprecated: Use ImportMessage.ProtoReflect.Type instead.
 func (*ImportMessage) Descriptor() ([]byte, []int) {

+ 12 - 5
internal/testprotos/test/test_public.pb.go

@@ -18,12 +18,19 @@ type PublicImportMessage struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *PublicImportMessage) ProtoReflect() protoreflect.Message {
-	return xxx_File_test_test_public_proto_messageTypes[0].MessageOf(m)
+func (x *PublicImportMessage) Reset() {
+	*x = PublicImportMessage{}
+}
+
+func (x *PublicImportMessage) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*PublicImportMessage) ProtoMessage() {}
+
+func (x *PublicImportMessage) ProtoReflect() protoreflect.Message {
+	return xxx_File_test_test_public_proto_messageTypes[0].MessageOf(x)
 }
-func (m *PublicImportMessage) Reset()         { *m = PublicImportMessage{} }
-func (m *PublicImportMessage) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*PublicImportMessage) ProtoMessage()    {}
 
 // Deprecated: Use PublicImportMessage.ProtoReflect.Type instead.
 func (*PublicImportMessage) Descriptor() ([]byte, []int) {

+ 12 - 5
internal/testprotos/test/test_weak.pb.go

@@ -18,12 +18,19 @@ type WeakImportMessage struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *WeakImportMessage) ProtoReflect() protoreflect.Message {
-	return xxx_File_test_test_weak_proto_messageTypes[0].MessageOf(m)
+func (x *WeakImportMessage) Reset() {
+	*x = WeakImportMessage{}
+}
+
+func (x *WeakImportMessage) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*WeakImportMessage) ProtoMessage() {}
+
+func (x *WeakImportMessage) ProtoReflect() protoreflect.Message {
+	return xxx_File_test_test_weak_proto_messageTypes[0].MessageOf(x)
 }
-func (m *WeakImportMessage) Reset()         { *m = WeakImportMessage{} }
-func (m *WeakImportMessage) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*WeakImportMessage) ProtoMessage()    {}
 
 // Deprecated: Use WeakImportMessage.ProtoReflect.Type instead.
 func (*WeakImportMessage) Descriptor() ([]byte, []int) {

+ 259 - 236
internal/testprotos/test3/test.pb.go

@@ -21,13 +21,6 @@ const (
 	ForeignEnum_FOREIGN_BAZ  ForeignEnum = 6
 )
 
-func (e ForeignEnum) Type() protoreflect.EnumType {
-	return xxx_File_test3_test_proto_enumTypes[0]
-}
-func (e ForeignEnum) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use ForeignEnum.Type.Values instead.
 var ForeignEnum_name = map[int32]string{
 	0: "FOREIGN_ZERO",
@@ -48,6 +41,14 @@ func (x ForeignEnum) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (ForeignEnum) Type() protoreflect.EnumType {
+	return xxx_File_test3_test_proto_enumTypes[0]
+}
+
+func (x ForeignEnum) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Use ForeignEnum.Type instead.
 func (ForeignEnum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_test3_test_proto_rawDescGZIP(), []int{0}
@@ -62,13 +63,6 @@ const (
 	TestAllTypes_NEG TestAllTypes_NestedEnum = -1
 )
 
-func (e TestAllTypes_NestedEnum) Type() protoreflect.EnumType {
-	return xxx_File_test3_test_proto_enumTypes[1]
-}
-func (e TestAllTypes_NestedEnum) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use TestAllTypes_NestedEnum.Type.Values instead.
 var TestAllTypes_NestedEnum_name = map[int32]string{
 	0:  "FOO",
@@ -89,6 +83,14 @@ func (x TestAllTypes_NestedEnum) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (TestAllTypes_NestedEnum) Type() protoreflect.EnumType {
+	return xxx_File_test3_test_proto_enumTypes[1]
+}
+
+func (x TestAllTypes_NestedEnum) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Use TestAllTypes_NestedEnum.Type instead.
 func (TestAllTypes_NestedEnum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_test3_test_proto_rawDescGZIP(), []int{0, 0}
@@ -170,427 +172,434 @@ type TestAllTypes struct {
 	XXX_sizecache        int32                     `json:"-"`
 }
 
-func (m *TestAllTypes) ProtoReflect() protoreflect.Message {
-	return xxx_File_test3_test_proto_messageTypes[0].MessageOf(m)
+func (x *TestAllTypes) Reset() {
+	*x = TestAllTypes{}
+}
+
+func (x *TestAllTypes) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TestAllTypes) ProtoMessage() {}
+
+func (x *TestAllTypes) ProtoReflect() protoreflect.Message {
+	return xxx_File_test3_test_proto_messageTypes[0].MessageOf(x)
 }
-func (m *TestAllTypes) Reset()         { *m = TestAllTypes{} }
-func (m *TestAllTypes) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*TestAllTypes) ProtoMessage()    {}
 
 // Deprecated: Use TestAllTypes.ProtoReflect.Type instead.
 func (*TestAllTypes) Descriptor() ([]byte, []int) {
 	return xxx_File_test3_test_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *TestAllTypes) GetOptionalInt32() int32 {
-	if m != nil {
-		return m.OptionalInt32
+func (x *TestAllTypes) GetOptionalInt32() int32 {
+	if x != nil {
+		return x.OptionalInt32
 	}
 	return 0
 }
 
-func (m *TestAllTypes) GetOptionalInt64() int64 {
-	if m != nil {
-		return m.OptionalInt64
+func (x *TestAllTypes) GetOptionalInt64() int64 {
+	if x != nil {
+		return x.OptionalInt64
 	}
 	return 0
 }
 
-func (m *TestAllTypes) GetOptionalUint32() uint32 {
-	if m != nil {
-		return m.OptionalUint32
+func (x *TestAllTypes) GetOptionalUint32() uint32 {
+	if x != nil {
+		return x.OptionalUint32
 	}
 	return 0
 }
 
-func (m *TestAllTypes) GetOptionalUint64() uint64 {
-	if m != nil {
-		return m.OptionalUint64
+func (x *TestAllTypes) GetOptionalUint64() uint64 {
+	if x != nil {
+		return x.OptionalUint64
 	}
 	return 0
 }
 
-func (m *TestAllTypes) GetOptionalSint32() int32 {
-	if m != nil {
-		return m.OptionalSint32
+func (x *TestAllTypes) GetOptionalSint32() int32 {
+	if x != nil {
+		return x.OptionalSint32
 	}
 	return 0
 }
 
-func (m *TestAllTypes) GetOptionalSint64() int64 {
-	if m != nil {
-		return m.OptionalSint64
+func (x *TestAllTypes) GetOptionalSint64() int64 {
+	if x != nil {
+		return x.OptionalSint64
 	}
 	return 0
 }
 
-func (m *TestAllTypes) GetOptionalFixed32() uint32 {
-	if m != nil {
-		return m.OptionalFixed32
+func (x *TestAllTypes) GetOptionalFixed32() uint32 {
+	if x != nil {
+		return x.OptionalFixed32
 	}
 	return 0
 }
 
-func (m *TestAllTypes) GetOptionalFixed64() uint64 {
-	if m != nil {
-		return m.OptionalFixed64
+func (x *TestAllTypes) GetOptionalFixed64() uint64 {
+	if x != nil {
+		return x.OptionalFixed64
 	}
 	return 0
 }
 
-func (m *TestAllTypes) GetOptionalSfixed32() int32 {
-	if m != nil {
-		return m.OptionalSfixed32
+func (x *TestAllTypes) GetOptionalSfixed32() int32 {
+	if x != nil {
+		return x.OptionalSfixed32
 	}
 	return 0
 }
 
-func (m *TestAllTypes) GetOptionalSfixed64() int64 {
-	if m != nil {
-		return m.OptionalSfixed64
+func (x *TestAllTypes) GetOptionalSfixed64() int64 {
+	if x != nil {
+		return x.OptionalSfixed64
 	}
 	return 0
 }
 
-func (m *TestAllTypes) GetOptionalFloat() float32 {
-	if m != nil {
-		return m.OptionalFloat
+func (x *TestAllTypes) GetOptionalFloat() float32 {
+	if x != nil {
+		return x.OptionalFloat
 	}
 	return 0
 }
 
-func (m *TestAllTypes) GetOptionalDouble() float64 {
-	if m != nil {
-		return m.OptionalDouble
+func (x *TestAllTypes) GetOptionalDouble() float64 {
+	if x != nil {
+		return x.OptionalDouble
 	}
 	return 0
 }
 
-func (m *TestAllTypes) GetOptionalBool() bool {
-	if m != nil {
-		return m.OptionalBool
+func (x *TestAllTypes) GetOptionalBool() bool {
+	if x != nil {
+		return x.OptionalBool
 	}
 	return false
 }
 
-func (m *TestAllTypes) GetOptionalString() string {
-	if m != nil {
-		return m.OptionalString
+func (x *TestAllTypes) GetOptionalString() string {
+	if x != nil {
+		return x.OptionalString
 	}
 	return ""
 }
 
-func (m *TestAllTypes) GetOptionalBytes() []byte {
-	if m != nil {
-		return m.OptionalBytes
+func (x *TestAllTypes) GetOptionalBytes() []byte {
+	if x != nil {
+		return x.OptionalBytes
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetOptionalNestedMessage() *TestAllTypes_NestedMessage {
-	if m != nil {
-		return m.OptionalNestedMessage
+func (x *TestAllTypes) GetOptionalNestedMessage() *TestAllTypes_NestedMessage {
+	if x != nil {
+		return x.OptionalNestedMessage
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetOptionalForeignMessage() *ForeignMessage {
-	if m != nil {
-		return m.OptionalForeignMessage
+func (x *TestAllTypes) GetOptionalForeignMessage() *ForeignMessage {
+	if x != nil {
+		return x.OptionalForeignMessage
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetOptionalImportMessage() *ImportMessage {
-	if m != nil {
-		return m.OptionalImportMessage
+func (x *TestAllTypes) GetOptionalImportMessage() *ImportMessage {
+	if x != nil {
+		return x.OptionalImportMessage
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetOptionalNestedEnum() TestAllTypes_NestedEnum {
-	if m != nil {
-		return m.OptionalNestedEnum
+func (x *TestAllTypes) GetOptionalNestedEnum() TestAllTypes_NestedEnum {
+	if x != nil {
+		return x.OptionalNestedEnum
 	}
 	return TestAllTypes_FOO
 }
 
-func (m *TestAllTypes) GetOptionalForeignEnum() ForeignEnum {
-	if m != nil {
-		return m.OptionalForeignEnum
+func (x *TestAllTypes) GetOptionalForeignEnum() ForeignEnum {
+	if x != nil {
+		return x.OptionalForeignEnum
 	}
 	return ForeignEnum_FOREIGN_ZERO
 }
 
-func (m *TestAllTypes) GetOptionalImportEnum() ImportEnum {
-	if m != nil {
-		return m.OptionalImportEnum
+func (x *TestAllTypes) GetOptionalImportEnum() ImportEnum {
+	if x != nil {
+		return x.OptionalImportEnum
 	}
 	return ImportEnum_IMPORT_ZERO
 }
 
-func (m *TestAllTypes) GetRepeatedInt32() []int32 {
-	if m != nil {
-		return m.RepeatedInt32
+func (x *TestAllTypes) GetRepeatedInt32() []int32 {
+	if x != nil {
+		return x.RepeatedInt32
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedInt64() []int64 {
-	if m != nil {
-		return m.RepeatedInt64
+func (x *TestAllTypes) GetRepeatedInt64() []int64 {
+	if x != nil {
+		return x.RepeatedInt64
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedUint32() []uint32 {
-	if m != nil {
-		return m.RepeatedUint32
+func (x *TestAllTypes) GetRepeatedUint32() []uint32 {
+	if x != nil {
+		return x.RepeatedUint32
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedUint64() []uint64 {
-	if m != nil {
-		return m.RepeatedUint64
+func (x *TestAllTypes) GetRepeatedUint64() []uint64 {
+	if x != nil {
+		return x.RepeatedUint64
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedSint32() []int32 {
-	if m != nil {
-		return m.RepeatedSint32
+func (x *TestAllTypes) GetRepeatedSint32() []int32 {
+	if x != nil {
+		return x.RepeatedSint32
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedSint64() []int64 {
-	if m != nil {
-		return m.RepeatedSint64
+func (x *TestAllTypes) GetRepeatedSint64() []int64 {
+	if x != nil {
+		return x.RepeatedSint64
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedFixed32() []uint32 {
-	if m != nil {
-		return m.RepeatedFixed32
+func (x *TestAllTypes) GetRepeatedFixed32() []uint32 {
+	if x != nil {
+		return x.RepeatedFixed32
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedFixed64() []uint64 {
-	if m != nil {
-		return m.RepeatedFixed64
+func (x *TestAllTypes) GetRepeatedFixed64() []uint64 {
+	if x != nil {
+		return x.RepeatedFixed64
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedSfixed32() []int32 {
-	if m != nil {
-		return m.RepeatedSfixed32
+func (x *TestAllTypes) GetRepeatedSfixed32() []int32 {
+	if x != nil {
+		return x.RepeatedSfixed32
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedSfixed64() []int64 {
-	if m != nil {
-		return m.RepeatedSfixed64
+func (x *TestAllTypes) GetRepeatedSfixed64() []int64 {
+	if x != nil {
+		return x.RepeatedSfixed64
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedFloat() []float32 {
-	if m != nil {
-		return m.RepeatedFloat
+func (x *TestAllTypes) GetRepeatedFloat() []float32 {
+	if x != nil {
+		return x.RepeatedFloat
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedDouble() []float64 {
-	if m != nil {
-		return m.RepeatedDouble
+func (x *TestAllTypes) GetRepeatedDouble() []float64 {
+	if x != nil {
+		return x.RepeatedDouble
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedBool() []bool {
-	if m != nil {
-		return m.RepeatedBool
+func (x *TestAllTypes) GetRepeatedBool() []bool {
+	if x != nil {
+		return x.RepeatedBool
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedString() []string {
-	if m != nil {
-		return m.RepeatedString
+func (x *TestAllTypes) GetRepeatedString() []string {
+	if x != nil {
+		return x.RepeatedString
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedBytes() [][]byte {
-	if m != nil {
-		return m.RepeatedBytes
+func (x *TestAllTypes) GetRepeatedBytes() [][]byte {
+	if x != nil {
+		return x.RepeatedBytes
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedNestedMessage() []*TestAllTypes_NestedMessage {
-	if m != nil {
-		return m.RepeatedNestedMessage
+func (x *TestAllTypes) GetRepeatedNestedMessage() []*TestAllTypes_NestedMessage {
+	if x != nil {
+		return x.RepeatedNestedMessage
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedForeignMessage() []*ForeignMessage {
-	if m != nil {
-		return m.RepeatedForeignMessage
+func (x *TestAllTypes) GetRepeatedForeignMessage() []*ForeignMessage {
+	if x != nil {
+		return x.RepeatedForeignMessage
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedImportmessage() []*ImportMessage {
-	if m != nil {
-		return m.RepeatedImportmessage
+func (x *TestAllTypes) GetRepeatedImportmessage() []*ImportMessage {
+	if x != nil {
+		return x.RepeatedImportmessage
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedNestedEnum() []TestAllTypes_NestedEnum {
-	if m != nil {
-		return m.RepeatedNestedEnum
+func (x *TestAllTypes) GetRepeatedNestedEnum() []TestAllTypes_NestedEnum {
+	if x != nil {
+		return x.RepeatedNestedEnum
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedForeignEnum() []ForeignEnum {
-	if m != nil {
-		return m.RepeatedForeignEnum
+func (x *TestAllTypes) GetRepeatedForeignEnum() []ForeignEnum {
+	if x != nil {
+		return x.RepeatedForeignEnum
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetRepeatedImportenum() []ImportEnum {
-	if m != nil {
-		return m.RepeatedImportenum
+func (x *TestAllTypes) GetRepeatedImportenum() []ImportEnum {
+	if x != nil {
+		return x.RepeatedImportenum
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapInt32Int32() map[int32]int32 {
-	if m != nil {
-		return m.MapInt32Int32
+func (x *TestAllTypes) GetMapInt32Int32() map[int32]int32 {
+	if x != nil {
+		return x.MapInt32Int32
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapInt64Int64() map[int64]int64 {
-	if m != nil {
-		return m.MapInt64Int64
+func (x *TestAllTypes) GetMapInt64Int64() map[int64]int64 {
+	if x != nil {
+		return x.MapInt64Int64
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapUint32Uint32() map[uint32]uint32 {
-	if m != nil {
-		return m.MapUint32Uint32
+func (x *TestAllTypes) GetMapUint32Uint32() map[uint32]uint32 {
+	if x != nil {
+		return x.MapUint32Uint32
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapUint64Uint64() map[uint64]uint64 {
-	if m != nil {
-		return m.MapUint64Uint64
+func (x *TestAllTypes) GetMapUint64Uint64() map[uint64]uint64 {
+	if x != nil {
+		return x.MapUint64Uint64
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapSint32Sint32() map[int32]int32 {
-	if m != nil {
-		return m.MapSint32Sint32
+func (x *TestAllTypes) GetMapSint32Sint32() map[int32]int32 {
+	if x != nil {
+		return x.MapSint32Sint32
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapSint64Sint64() map[int64]int64 {
-	if m != nil {
-		return m.MapSint64Sint64
+func (x *TestAllTypes) GetMapSint64Sint64() map[int64]int64 {
+	if x != nil {
+		return x.MapSint64Sint64
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapFixed32Fixed32() map[uint32]uint32 {
-	if m != nil {
-		return m.MapFixed32Fixed32
+func (x *TestAllTypes) GetMapFixed32Fixed32() map[uint32]uint32 {
+	if x != nil {
+		return x.MapFixed32Fixed32
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapFixed64Fixed64() map[uint64]uint64 {
-	if m != nil {
-		return m.MapFixed64Fixed64
+func (x *TestAllTypes) GetMapFixed64Fixed64() map[uint64]uint64 {
+	if x != nil {
+		return x.MapFixed64Fixed64
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapSfixed32Sfixed32() map[int32]int32 {
-	if m != nil {
-		return m.MapSfixed32Sfixed32
+func (x *TestAllTypes) GetMapSfixed32Sfixed32() map[int32]int32 {
+	if x != nil {
+		return x.MapSfixed32Sfixed32
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapSfixed64Sfixed64() map[int64]int64 {
-	if m != nil {
-		return m.MapSfixed64Sfixed64
+func (x *TestAllTypes) GetMapSfixed64Sfixed64() map[int64]int64 {
+	if x != nil {
+		return x.MapSfixed64Sfixed64
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapInt32Float() map[int32]float32 {
-	if m != nil {
-		return m.MapInt32Float
+func (x *TestAllTypes) GetMapInt32Float() map[int32]float32 {
+	if x != nil {
+		return x.MapInt32Float
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapInt32Double() map[int32]float64 {
-	if m != nil {
-		return m.MapInt32Double
+func (x *TestAllTypes) GetMapInt32Double() map[int32]float64 {
+	if x != nil {
+		return x.MapInt32Double
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapBoolBool() map[bool]bool {
-	if m != nil {
-		return m.MapBoolBool
+func (x *TestAllTypes) GetMapBoolBool() map[bool]bool {
+	if x != nil {
+		return x.MapBoolBool
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapStringString() map[string]string {
-	if m != nil {
-		return m.MapStringString
+func (x *TestAllTypes) GetMapStringString() map[string]string {
+	if x != nil {
+		return x.MapStringString
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapStringBytes() map[string][]byte {
-	if m != nil {
-		return m.MapStringBytes
+func (x *TestAllTypes) GetMapStringBytes() map[string][]byte {
+	if x != nil {
+		return x.MapStringBytes
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapStringNestedMessage() map[string]*TestAllTypes_NestedMessage {
-	if m != nil {
-		return m.MapStringNestedMessage
+func (x *TestAllTypes) GetMapStringNestedMessage() map[string]*TestAllTypes_NestedMessage {
+	if x != nil {
+		return x.MapStringNestedMessage
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetMapStringNestedEnum() map[string]TestAllTypes_NestedEnum {
-	if m != nil {
-		return m.MapStringNestedEnum
+func (x *TestAllTypes) GetMapStringNestedEnum() map[string]TestAllTypes_NestedEnum {
+	if x != nil {
+		return x.MapStringNestedEnum
 	}
 	return nil
 }
@@ -660,64 +669,64 @@ func (m *TestAllTypes) GetOneofField() isTestAllTypes_OneofField {
 	return nil
 }
 
-func (m *TestAllTypes) GetOneofUint32() uint32 {
-	if x, ok := m.GetOneofField().(*TestAllTypes_OneofUint32); ok {
+func (x *TestAllTypes) GetOneofUint32() uint32 {
+	if x, ok := x.GetOneofField().(*TestAllTypes_OneofUint32); ok {
 		return x.OneofUint32
 	}
 	return 0
 }
 
-func (m *TestAllTypes) GetOneofNestedMessage() *TestAllTypes_NestedMessage {
-	if x, ok := m.GetOneofField().(*TestAllTypes_OneofNestedMessage); ok {
+func (x *TestAllTypes) GetOneofNestedMessage() *TestAllTypes_NestedMessage {
+	if x, ok := x.GetOneofField().(*TestAllTypes_OneofNestedMessage); ok {
 		return x.OneofNestedMessage
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetOneofString() string {
-	if x, ok := m.GetOneofField().(*TestAllTypes_OneofString); ok {
+func (x *TestAllTypes) GetOneofString() string {
+	if x, ok := x.GetOneofField().(*TestAllTypes_OneofString); ok {
 		return x.OneofString
 	}
 	return ""
 }
 
-func (m *TestAllTypes) GetOneofBytes() []byte {
-	if x, ok := m.GetOneofField().(*TestAllTypes_OneofBytes); ok {
+func (x *TestAllTypes) GetOneofBytes() []byte {
+	if x, ok := x.GetOneofField().(*TestAllTypes_OneofBytes); ok {
 		return x.OneofBytes
 	}
 	return nil
 }
 
-func (m *TestAllTypes) GetOneofBool() bool {
-	if x, ok := m.GetOneofField().(*TestAllTypes_OneofBool); ok {
+func (x *TestAllTypes) GetOneofBool() bool {
+	if x, ok := x.GetOneofField().(*TestAllTypes_OneofBool); ok {
 		return x.OneofBool
 	}
 	return false
 }
 
-func (m *TestAllTypes) GetOneofUint64() uint64 {
-	if x, ok := m.GetOneofField().(*TestAllTypes_OneofUint64); ok {
+func (x *TestAllTypes) GetOneofUint64() uint64 {
+	if x, ok := x.GetOneofField().(*TestAllTypes_OneofUint64); ok {
 		return x.OneofUint64
 	}
 	return 0
 }
 
-func (m *TestAllTypes) GetOneofFloat() float32 {
-	if x, ok := m.GetOneofField().(*TestAllTypes_OneofFloat); ok {
+func (x *TestAllTypes) GetOneofFloat() float32 {
+	if x, ok := x.GetOneofField().(*TestAllTypes_OneofFloat); ok {
 		return x.OneofFloat
 	}
 	return 0
 }
 
-func (m *TestAllTypes) GetOneofDouble() float64 {
-	if x, ok := m.GetOneofField().(*TestAllTypes_OneofDouble); ok {
+func (x *TestAllTypes) GetOneofDouble() float64 {
+	if x, ok := x.GetOneofField().(*TestAllTypes_OneofDouble); ok {
 		return x.OneofDouble
 	}
 	return 0
 }
 
-func (m *TestAllTypes) GetOneofEnum() TestAllTypes_NestedEnum {
-	if x, ok := m.GetOneofField().(*TestAllTypes_OneofEnum); ok {
+func (x *TestAllTypes) GetOneofEnum() TestAllTypes_NestedEnum {
+	if x, ok := x.GetOneofField().(*TestAllTypes_OneofEnum); ok {
 		return x.OneofEnum
 	}
 	return TestAllTypes_FOO
@@ -746,28 +755,35 @@ type ForeignMessage struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *ForeignMessage) ProtoReflect() protoreflect.Message {
-	return xxx_File_test3_test_proto_messageTypes[1].MessageOf(m)
+func (x *ForeignMessage) Reset() {
+	*x = ForeignMessage{}
+}
+
+func (x *ForeignMessage) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ForeignMessage) ProtoMessage() {}
+
+func (x *ForeignMessage) ProtoReflect() protoreflect.Message {
+	return xxx_File_test3_test_proto_messageTypes[1].MessageOf(x)
 }
-func (m *ForeignMessage) Reset()         { *m = ForeignMessage{} }
-func (m *ForeignMessage) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*ForeignMessage) ProtoMessage()    {}
 
 // Deprecated: Use ForeignMessage.ProtoReflect.Type instead.
 func (*ForeignMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_test3_test_proto_rawDescGZIP(), []int{1}
 }
 
-func (m *ForeignMessage) GetC() int32 {
-	if m != nil {
-		return m.C
+func (x *ForeignMessage) GetC() int32 {
+	if x != nil {
+		return x.C
 	}
 	return 0
 }
 
-func (m *ForeignMessage) GetD() int32 {
-	if m != nil {
-		return m.D
+func (x *ForeignMessage) GetD() int32 {
+	if x != nil {
+		return x.D
 	}
 	return 0
 }
@@ -780,28 +796,35 @@ type TestAllTypes_NestedMessage struct {
 	XXX_sizecache        int32         `json:"-"`
 }
 
-func (m *TestAllTypes_NestedMessage) ProtoReflect() protoreflect.Message {
-	return xxx_File_test3_test_proto_messageTypes[2].MessageOf(m)
+func (x *TestAllTypes_NestedMessage) Reset() {
+	*x = TestAllTypes_NestedMessage{}
+}
+
+func (x *TestAllTypes_NestedMessage) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TestAllTypes_NestedMessage) ProtoMessage() {}
+
+func (x *TestAllTypes_NestedMessage) ProtoReflect() protoreflect.Message {
+	return xxx_File_test3_test_proto_messageTypes[2].MessageOf(x)
 }
-func (m *TestAllTypes_NestedMessage) Reset()         { *m = TestAllTypes_NestedMessage{} }
-func (m *TestAllTypes_NestedMessage) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*TestAllTypes_NestedMessage) ProtoMessage()    {}
 
 // Deprecated: Use TestAllTypes_NestedMessage.ProtoReflect.Type instead.
 func (*TestAllTypes_NestedMessage) Descriptor() ([]byte, []int) {
 	return xxx_File_test3_test_proto_rawDescGZIP(), []int{0, 0}
 }
 
-func (m *TestAllTypes_NestedMessage) GetA() int32 {
-	if m != nil {
-		return m.A
+func (x *TestAllTypes_NestedMessage) GetA() int32 {
+	if x != nil {
+		return x.A
 	}
 	return 0
 }
 
-func (m *TestAllTypes_NestedMessage) GetCorecursive() *TestAllTypes {
-	if m != nil {
-		return m.Corecursive
+func (x *TestAllTypes_NestedMessage) GetCorecursive() *TestAllTypes {
+	if x != nil {
+		return x.Corecursive
 	}
 	return nil
 }

+ 20 - 12
internal/testprotos/test3/test_import.pb.go

@@ -18,13 +18,6 @@ const (
 	ImportEnum_IMPORT_ZERO ImportEnum = 0
 )
 
-func (e ImportEnum) Type() protoreflect.EnumType {
-	return xxx_File_test3_test_import_proto_enumTypes[0]
-}
-func (e ImportEnum) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use ImportEnum.Type.Values instead.
 var ImportEnum_name = map[int32]string{
 	0: "IMPORT_ZERO",
@@ -39,6 +32,14 @@ func (x ImportEnum) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (ImportEnum) Type() protoreflect.EnumType {
+	return xxx_File_test3_test_import_proto_enumTypes[0]
+}
+
+func (x ImportEnum) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Use ImportEnum.Type instead.
 func (ImportEnum) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_test3_test_import_proto_rawDescGZIP(), []int{0}
@@ -50,12 +51,19 @@ type ImportMessage struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *ImportMessage) ProtoReflect() protoreflect.Message {
-	return xxx_File_test3_test_import_proto_messageTypes[0].MessageOf(m)
+func (x *ImportMessage) Reset() {
+	*x = ImportMessage{}
+}
+
+func (x *ImportMessage) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ImportMessage) ProtoMessage() {}
+
+func (x *ImportMessage) ProtoReflect() protoreflect.Message {
+	return xxx_File_test3_test_import_proto_messageTypes[0].MessageOf(x)
 }
-func (m *ImportMessage) Reset()         { *m = ImportMessage{} }
-func (m *ImportMessage) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*ImportMessage) ProtoMessage()    {}
 
 // Deprecated: Use ImportMessage.ProtoReflect.Type instead.
 func (*ImportMessage) Descriptor() ([]byte, []int) {

+ 75 - 44
reflect/protoregistry/testprotos/test.pb.go

@@ -19,13 +19,6 @@ const (
 	Enum1_ONE Enum1 = 1
 )
 
-func (e Enum1) Type() protoreflect.EnumType {
-	return xxx_File_test_proto_enumTypes[0]
-}
-func (e Enum1) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use Enum1.Type.Values instead.
 var Enum1_name = map[int32]string{
 	1: "ONE",
@@ -44,6 +37,14 @@ func (x Enum1) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (Enum1) Type() protoreflect.EnumType {
+	return xxx_File_test_proto_enumTypes[0]
+}
+
+func (x Enum1) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Do not use.
 func (x *Enum1) UnmarshalJSON(b []byte) error {
 	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
@@ -65,13 +66,6 @@ const (
 	Enum2_UNO Enum2 = 1
 )
 
-func (e Enum2) Type() protoreflect.EnumType {
-	return xxx_File_test_proto_enumTypes[1]
-}
-func (e Enum2) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use Enum2.Type.Values instead.
 var Enum2_name = map[int32]string{
 	1: "UNO",
@@ -90,6 +84,14 @@ func (x Enum2) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (Enum2) Type() protoreflect.EnumType {
+	return xxx_File_test_proto_enumTypes[1]
+}
+
+func (x Enum2) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Do not use.
 func (x *Enum2) UnmarshalJSON(b []byte) error {
 	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
@@ -111,13 +113,6 @@ const (
 	Enum3_YI Enum3 = 1
 )
 
-func (e Enum3) Type() protoreflect.EnumType {
-	return xxx_File_test_proto_enumTypes[2]
-}
-func (e Enum3) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use Enum3.Type.Values instead.
 var Enum3_name = map[int32]string{
 	1: "YI",
@@ -136,6 +131,14 @@ func (x Enum3) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (Enum3) Type() protoreflect.EnumType {
+	return xxx_File_test_proto_enumTypes[2]
+}
+
+func (x Enum3) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Do not use.
 func (x *Enum3) UnmarshalJSON(b []byte) error {
 	num, err := protoimpl.X.UnmarshalJSONEnum(x.Type(), b)
@@ -158,12 +161,19 @@ type Message1 struct {
 	XXX_sizecache          int32                       `json:"-"`
 }
 
-func (m *Message1) ProtoReflect() protoreflect.Message {
-	return xxx_File_test_proto_messageTypes[0].MessageOf(m)
+func (x *Message1) Reset() {
+	*x = Message1{}
+}
+
+func (x *Message1) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message1) ProtoMessage() {}
+
+func (x *Message1) ProtoReflect() protoreflect.Message {
+	return xxx_File_test_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Message1) Reset()         { *m = Message1{} }
-func (m *Message1) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message1) ProtoMessage()    {}
 
 // Deprecated: Use Message1.ProtoReflect.Type instead.
 func (*Message1) Descriptor() ([]byte, []int) {
@@ -185,12 +195,19 @@ type Message2 struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Message2) ProtoReflect() protoreflect.Message {
-	return xxx_File_test_proto_messageTypes[1].MessageOf(m)
+func (x *Message2) Reset() {
+	*x = Message2{}
+}
+
+func (x *Message2) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message2) ProtoMessage() {}
+
+func (x *Message2) ProtoReflect() protoreflect.Message {
+	return xxx_File_test_proto_messageTypes[1].MessageOf(x)
 }
-func (m *Message2) Reset()         { *m = Message2{} }
-func (m *Message2) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message2) ProtoMessage()    {}
 
 // Deprecated: Use Message2.ProtoReflect.Type instead.
 func (*Message2) Descriptor() ([]byte, []int) {
@@ -203,12 +220,19 @@ type Message3 struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Message3) ProtoReflect() protoreflect.Message {
-	return xxx_File_test_proto_messageTypes[2].MessageOf(m)
+func (x *Message3) Reset() {
+	*x = Message3{}
+}
+
+func (x *Message3) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message3) ProtoMessage() {}
+
+func (x *Message3) ProtoReflect() protoreflect.Message {
+	return xxx_File_test_proto_messageTypes[2].MessageOf(x)
 }
-func (m *Message3) Reset()         { *m = Message3{} }
-func (m *Message3) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message3) ProtoMessage()    {}
 
 // Deprecated: Use Message3.ProtoReflect.Type instead.
 func (*Message3) Descriptor() ([]byte, []int) {
@@ -222,21 +246,28 @@ type Message4 struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Message4) ProtoReflect() protoreflect.Message {
-	return xxx_File_test_proto_messageTypes[3].MessageOf(m)
+func (x *Message4) Reset() {
+	*x = Message4{}
+}
+
+func (x *Message4) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message4) ProtoMessage() {}
+
+func (x *Message4) ProtoReflect() protoreflect.Message {
+	return xxx_File_test_proto_messageTypes[3].MessageOf(x)
 }
-func (m *Message4) Reset()         { *m = Message4{} }
-func (m *Message4) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Message4) ProtoMessage()    {}
 
 // Deprecated: Use Message4.ProtoReflect.Type instead.
 func (*Message4) Descriptor() ([]byte, []int) {
 	return xxx_File_test_proto_rawDescGZIP(), []int{3}
 }
 
-func (m *Message4) GetBoolField() bool {
-	if m != nil && m.BoolField != nil {
-		return *m.BoolField
+func (x *Message4) GetBoolField() bool {
+	if x != nil && x.BoolField != nil {
+		return *x.BoolField
 	}
 	return false
 }

Разница между файлами не показана из-за своего большого размера
+ 339 - 256
types/descriptor/descriptor.pb.go


+ 18 - 11
types/known/any.pb.go

@@ -129,12 +129,19 @@ type Any struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Any) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_any_proto_messageTypes[0].MessageOf(m)
+func (x *Any) Reset() {
+	*x = Any{}
+}
+
+func (x *Any) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Any) ProtoMessage() {}
+
+func (x *Any) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_any_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Any) Reset()         { *m = Any{} }
-func (m *Any) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Any) ProtoMessage()    {}
 
 // Deprecated: Use Any.ProtoReflect.Type instead.
 func (*Any) Descriptor() ([]byte, []int) {
@@ -143,16 +150,16 @@ func (*Any) Descriptor() ([]byte, []int) {
 
 func (*Any) XXX_WellKnownType() string { return "Any" }
 
-func (m *Any) GetTypeUrl() string {
-	if m != nil {
-		return m.TypeUrl
+func (x *Any) GetTypeUrl() string {
+	if x != nil {
+		return x.TypeUrl
 	}
 	return ""
 }
 
-func (m *Any) GetValue() []byte {
-	if m != nil {
-		return m.Value
+func (x *Any) GetValue() []byte {
+	if x != nil {
+		return x.Value
 	}
 	return nil
 }

+ 84 - 63
types/known/api.pb.go

@@ -63,63 +63,70 @@ type Api struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Api) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_api_proto_messageTypes[0].MessageOf(m)
+func (x *Api) Reset() {
+	*x = Api{}
+}
+
+func (x *Api) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Api) ProtoMessage() {}
+
+func (x *Api) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_api_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Api) Reset()         { *m = Api{} }
-func (m *Api) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Api) ProtoMessage()    {}
 
 // Deprecated: Use Api.ProtoReflect.Type instead.
 func (*Api) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_api_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *Api) GetName() string {
-	if m != nil {
-		return m.Name
+func (x *Api) GetName() string {
+	if x != nil {
+		return x.Name
 	}
 	return ""
 }
 
-func (m *Api) GetMethods() []*Method {
-	if m != nil {
-		return m.Methods
+func (x *Api) GetMethods() []*Method {
+	if x != nil {
+		return x.Methods
 	}
 	return nil
 }
 
-func (m *Api) GetOptions() []*Option {
-	if m != nil {
-		return m.Options
+func (x *Api) GetOptions() []*Option {
+	if x != nil {
+		return x.Options
 	}
 	return nil
 }
 
-func (m *Api) GetVersion() string {
-	if m != nil {
-		return m.Version
+func (x *Api) GetVersion() string {
+	if x != nil {
+		return x.Version
 	}
 	return ""
 }
 
-func (m *Api) GetSourceContext() *SourceContext {
-	if m != nil {
-		return m.SourceContext
+func (x *Api) GetSourceContext() *SourceContext {
+	if x != nil {
+		return x.SourceContext
 	}
 	return nil
 }
 
-func (m *Api) GetMixins() []*Mixin {
-	if m != nil {
-		return m.Mixins
+func (x *Api) GetMixins() []*Mixin {
+	if x != nil {
+		return x.Mixins
 	}
 	return nil
 }
 
-func (m *Api) GetSyntax() Syntax {
-	if m != nil {
-		return m.Syntax
+func (x *Api) GetSyntax() Syntax {
+	if x != nil {
+		return x.Syntax
 	}
 	return Syntax_SYNTAX_PROTO2
 }
@@ -145,63 +152,70 @@ type Method struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Method) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_api_proto_messageTypes[1].MessageOf(m)
+func (x *Method) Reset() {
+	*x = Method{}
+}
+
+func (x *Method) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Method) ProtoMessage() {}
+
+func (x *Method) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_api_proto_messageTypes[1].MessageOf(x)
 }
-func (m *Method) Reset()         { *m = Method{} }
-func (m *Method) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Method) ProtoMessage()    {}
 
 // Deprecated: Use Method.ProtoReflect.Type instead.
 func (*Method) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_api_proto_rawDescGZIP(), []int{1}
 }
 
-func (m *Method) GetName() string {
-	if m != nil {
-		return m.Name
+func (x *Method) GetName() string {
+	if x != nil {
+		return x.Name
 	}
 	return ""
 }
 
-func (m *Method) GetRequestTypeUrl() string {
-	if m != nil {
-		return m.RequestTypeUrl
+func (x *Method) GetRequestTypeUrl() string {
+	if x != nil {
+		return x.RequestTypeUrl
 	}
 	return ""
 }
 
-func (m *Method) GetRequestStreaming() bool {
-	if m != nil {
-		return m.RequestStreaming
+func (x *Method) GetRequestStreaming() bool {
+	if x != nil {
+		return x.RequestStreaming
 	}
 	return false
 }
 
-func (m *Method) GetResponseTypeUrl() string {
-	if m != nil {
-		return m.ResponseTypeUrl
+func (x *Method) GetResponseTypeUrl() string {
+	if x != nil {
+		return x.ResponseTypeUrl
 	}
 	return ""
 }
 
-func (m *Method) GetResponseStreaming() bool {
-	if m != nil {
-		return m.ResponseStreaming
+func (x *Method) GetResponseStreaming() bool {
+	if x != nil {
+		return x.ResponseStreaming
 	}
 	return false
 }
 
-func (m *Method) GetOptions() []*Option {
-	if m != nil {
-		return m.Options
+func (x *Method) GetOptions() []*Option {
+	if x != nil {
+		return x.Options
 	}
 	return nil
 }
 
-func (m *Method) GetSyntax() Syntax {
-	if m != nil {
-		return m.Syntax
+func (x *Method) GetSyntax() Syntax {
+	if x != nil {
+		return x.Syntax
 	}
 	return Syntax_SYNTAX_PROTO2
 }
@@ -295,28 +309,35 @@ type Mixin struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Mixin) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_api_proto_messageTypes[2].MessageOf(m)
+func (x *Mixin) Reset() {
+	*x = Mixin{}
+}
+
+func (x *Mixin) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Mixin) ProtoMessage() {}
+
+func (x *Mixin) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_api_proto_messageTypes[2].MessageOf(x)
 }
-func (m *Mixin) Reset()         { *m = Mixin{} }
-func (m *Mixin) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Mixin) ProtoMessage()    {}
 
 // Deprecated: Use Mixin.ProtoReflect.Type instead.
 func (*Mixin) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_api_proto_rawDescGZIP(), []int{2}
 }
 
-func (m *Mixin) GetName() string {
-	if m != nil {
-		return m.Name
+func (x *Mixin) GetName() string {
+	if x != nil {
+		return x.Name
 	}
 	return ""
 }
 
-func (m *Mixin) GetRoot() string {
-	if m != nil {
-		return m.Root
+func (x *Mixin) GetRoot() string {
+	if x != nil {
+		return x.Root
 	}
 	return ""
 }

+ 18 - 11
types/known/duration.pb.go

@@ -89,12 +89,19 @@ type Duration struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Duration) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_duration_proto_messageTypes[0].MessageOf(m)
+func (x *Duration) Reset() {
+	*x = Duration{}
+}
+
+func (x *Duration) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Duration) ProtoMessage() {}
+
+func (x *Duration) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_duration_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Duration) Reset()         { *m = Duration{} }
-func (m *Duration) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Duration) ProtoMessage()    {}
 
 // Deprecated: Use Duration.ProtoReflect.Type instead.
 func (*Duration) Descriptor() ([]byte, []int) {
@@ -103,16 +110,16 @@ func (*Duration) Descriptor() ([]byte, []int) {
 
 func (*Duration) XXX_WellKnownType() string { return "Duration" }
 
-func (m *Duration) GetSeconds() int64 {
-	if m != nil {
-		return m.Seconds
+func (x *Duration) GetSeconds() int64 {
+	if x != nil {
+		return x.Seconds
 	}
 	return 0
 }
 
-func (m *Duration) GetNanos() int32 {
-	if m != nil {
-		return m.Nanos
+func (x *Duration) GetNanos() int32 {
+	if x != nil {
+		return x.Nanos
 	}
 	return 0
 }

+ 12 - 5
types/known/empty.pb.go

@@ -27,12 +27,19 @@ type Empty struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Empty) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_empty_proto_messageTypes[0].MessageOf(m)
+func (x *Empty) Reset() {
+	*x = Empty{}
+}
+
+func (x *Empty) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Empty) ProtoMessage() {}
+
+func (x *Empty) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_empty_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Empty) Reset()         { *m = Empty{} }
-func (m *Empty) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Empty) ProtoMessage()    {}
 
 // Deprecated: Use Empty.ProtoReflect.Type instead.
 func (*Empty) Descriptor() ([]byte, []int) {

+ 15 - 8
types/known/field_mask.pb.go

@@ -219,21 +219,28 @@ type FieldMask struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *FieldMask) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_field_mask_proto_messageTypes[0].MessageOf(m)
+func (x *FieldMask) Reset() {
+	*x = FieldMask{}
+}
+
+func (x *FieldMask) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*FieldMask) ProtoMessage() {}
+
+func (x *FieldMask) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_field_mask_proto_messageTypes[0].MessageOf(x)
 }
-func (m *FieldMask) Reset()         { *m = FieldMask{} }
-func (m *FieldMask) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*FieldMask) ProtoMessage()    {}
 
 // Deprecated: Use FieldMask.ProtoReflect.Type instead.
 func (*FieldMask) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_field_mask_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *FieldMask) GetPaths() []string {
-	if m != nil {
-		return m.Paths
+func (x *FieldMask) GetPaths() []string {
+	if x != nil {
+		return x.Paths
 	}
 	return nil
 }

+ 15 - 8
types/known/source_context.pb.go

@@ -23,21 +23,28 @@ type SourceContext struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *SourceContext) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_source_context_proto_messageTypes[0].MessageOf(m)
+func (x *SourceContext) Reset() {
+	*x = SourceContext{}
+}
+
+func (x *SourceContext) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SourceContext) ProtoMessage() {}
+
+func (x *SourceContext) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_source_context_proto_messageTypes[0].MessageOf(x)
 }
-func (m *SourceContext) Reset()         { *m = SourceContext{} }
-func (m *SourceContext) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*SourceContext) ProtoMessage()    {}
 
 // Deprecated: Use SourceContext.ProtoReflect.Type instead.
 func (*SourceContext) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_source_context_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *SourceContext) GetFileName() string {
-	if m != nil {
-		return m.FileName
+func (x *SourceContext) GetFileName() string {
+	if x != nil {
+		return x.FileName
 	}
 	return ""
 }

+ 62 - 40
types/known/struct.pb.go

@@ -23,13 +23,6 @@ const (
 	NullValue_NULL_VALUE NullValue = 0
 )
 
-func (e NullValue) Type() protoreflect.EnumType {
-	return xxx_File_google_protobuf_struct_proto_enumTypes[0]
-}
-func (e NullValue) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use NullValue.Type.Values instead.
 var NullValue_name = map[int32]string{
 	0: "NULL_VALUE",
@@ -44,6 +37,14 @@ func (x NullValue) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (NullValue) Type() protoreflect.EnumType {
+	return xxx_File_google_protobuf_struct_proto_enumTypes[0]
+}
+
+func (x NullValue) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Use NullValue.Type instead.
 func (NullValue) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_struct_proto_rawDescGZIP(), []int{0}
@@ -67,12 +68,19 @@ type Struct struct {
 	XXX_sizecache        int32             `json:"-"`
 }
 
-func (m *Struct) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_struct_proto_messageTypes[0].MessageOf(m)
+func (x *Struct) Reset() {
+	*x = Struct{}
+}
+
+func (x *Struct) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Struct) ProtoMessage() {}
+
+func (x *Struct) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_struct_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Struct) Reset()         { *m = Struct{} }
-func (m *Struct) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Struct) ProtoMessage()    {}
 
 // Deprecated: Use Struct.ProtoReflect.Type instead.
 func (*Struct) Descriptor() ([]byte, []int) {
@@ -81,9 +89,9 @@ func (*Struct) Descriptor() ([]byte, []int) {
 
 func (*Struct) XXX_WellKnownType() string { return "Struct" }
 
-func (m *Struct) GetFields() map[string]*Value {
-	if m != nil {
-		return m.Fields
+func (x *Struct) GetFields() map[string]*Value {
+	if x != nil {
+		return x.Fields
 	}
 	return nil
 }
@@ -116,12 +124,19 @@ type Value struct {
 	XXX_sizecache        int32        `json:"-"`
 }
 
-func (m *Value) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_struct_proto_messageTypes[1].MessageOf(m)
+func (x *Value) Reset() {
+	*x = Value{}
+}
+
+func (x *Value) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Value) ProtoMessage() {}
+
+func (x *Value) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_struct_proto_messageTypes[1].MessageOf(x)
 }
-func (m *Value) Reset()         { *m = Value{} }
-func (m *Value) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Value) ProtoMessage()    {}
 
 // Deprecated: Use Value.ProtoReflect.Type instead.
 func (*Value) Descriptor() ([]byte, []int) {
@@ -177,43 +192,43 @@ func (m *Value) GetKind() isValue_Kind {
 	return nil
 }
 
-func (m *Value) GetNullValue() NullValue {
-	if x, ok := m.GetKind().(*Value_NullValue); ok {
+func (x *Value) GetNullValue() NullValue {
+	if x, ok := x.GetKind().(*Value_NullValue); ok {
 		return x.NullValue
 	}
 	return NullValue_NULL_VALUE
 }
 
-func (m *Value) GetNumberValue() float64 {
-	if x, ok := m.GetKind().(*Value_NumberValue); ok {
+func (x *Value) GetNumberValue() float64 {
+	if x, ok := x.GetKind().(*Value_NumberValue); ok {
 		return x.NumberValue
 	}
 	return 0
 }
 
-func (m *Value) GetStringValue() string {
-	if x, ok := m.GetKind().(*Value_StringValue); ok {
+func (x *Value) GetStringValue() string {
+	if x, ok := x.GetKind().(*Value_StringValue); ok {
 		return x.StringValue
 	}
 	return ""
 }
 
-func (m *Value) GetBoolValue() bool {
-	if x, ok := m.GetKind().(*Value_BoolValue); ok {
+func (x *Value) GetBoolValue() bool {
+	if x, ok := x.GetKind().(*Value_BoolValue); ok {
 		return x.BoolValue
 	}
 	return false
 }
 
-func (m *Value) GetStructValue() *Struct {
-	if x, ok := m.GetKind().(*Value_StructValue); ok {
+func (x *Value) GetStructValue() *Struct {
+	if x, ok := x.GetKind().(*Value_StructValue); ok {
 		return x.StructValue
 	}
 	return nil
 }
 
-func (m *Value) GetListValue() *ListValue {
-	if x, ok := m.GetKind().(*Value_ListValue); ok {
+func (x *Value) GetListValue() *ListValue {
+	if x, ok := x.GetKind().(*Value_ListValue); ok {
 		return x.ListValue
 	}
 	return nil
@@ -242,12 +257,19 @@ type ListValue struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *ListValue) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_struct_proto_messageTypes[2].MessageOf(m)
+func (x *ListValue) Reset() {
+	*x = ListValue{}
+}
+
+func (x *ListValue) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListValue) ProtoMessage() {}
+
+func (x *ListValue) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_struct_proto_messageTypes[2].MessageOf(x)
 }
-func (m *ListValue) Reset()         { *m = ListValue{} }
-func (m *ListValue) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*ListValue) ProtoMessage()    {}
 
 // Deprecated: Use ListValue.ProtoReflect.Type instead.
 func (*ListValue) Descriptor() ([]byte, []int) {
@@ -256,9 +278,9 @@ func (*ListValue) Descriptor() ([]byte, []int) {
 
 func (*ListValue) XXX_WellKnownType() string { return "ListValue" }
 
-func (m *ListValue) GetValues() []*Value {
-	if m != nil {
-		return m.Values
+func (x *ListValue) GetValues() []*Value {
+	if x != nil {
+		return x.Values
 	}
 	return nil
 }

+ 18 - 11
types/known/timestamp.pb.go

@@ -109,12 +109,19 @@ type Timestamp struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Timestamp) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_timestamp_proto_messageTypes[0].MessageOf(m)
+func (x *Timestamp) Reset() {
+	*x = Timestamp{}
+}
+
+func (x *Timestamp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Timestamp) ProtoMessage() {}
+
+func (x *Timestamp) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_timestamp_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Timestamp) Reset()         { *m = Timestamp{} }
-func (m *Timestamp) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Timestamp) ProtoMessage()    {}
 
 // Deprecated: Use Timestamp.ProtoReflect.Type instead.
 func (*Timestamp) Descriptor() ([]byte, []int) {
@@ -123,16 +130,16 @@ func (*Timestamp) Descriptor() ([]byte, []int) {
 
 func (*Timestamp) XXX_WellKnownType() string { return "Timestamp" }
 
-func (m *Timestamp) GetSeconds() int64 {
-	if m != nil {
-		return m.Seconds
+func (x *Timestamp) GetSeconds() int64 {
+	if x != nil {
+		return x.Seconds
 	}
 	return 0
 }
 
-func (m *Timestamp) GetNanos() int32 {
-	if m != nil {
-		return m.Nanos
+func (x *Timestamp) GetNanos() int32 {
+	if x != nil {
+		return x.Nanos
 	}
 	return 0
 }

+ 162 - 124
types/known/type.pb.go

@@ -22,13 +22,6 @@ const (
 	Syntax_SYNTAX_PROTO3 Syntax = 1
 )
 
-func (e Syntax) Type() protoreflect.EnumType {
-	return xxx_File_google_protobuf_type_proto_enumTypes[0]
-}
-func (e Syntax) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use Syntax.Type.Values instead.
 var Syntax_name = map[int32]string{
 	0: "SYNTAX_PROTO2",
@@ -45,6 +38,14 @@ func (x Syntax) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (Syntax) Type() protoreflect.EnumType {
+	return xxx_File_google_protobuf_type_proto_enumTypes[0]
+}
+
+func (x Syntax) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Use Syntax.Type instead.
 func (Syntax) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_type_proto_rawDescGZIP(), []int{0}
@@ -94,13 +95,6 @@ const (
 	Field_TYPE_SINT64 Field_Kind = 18
 )
 
-func (e Field_Kind) Type() protoreflect.EnumType {
-	return xxx_File_google_protobuf_type_proto_enumTypes[1]
-}
-func (e Field_Kind) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use Field_Kind.Type.Values instead.
 var Field_Kind_name = map[int32]string{
 	0:  "TYPE_UNKNOWN",
@@ -151,6 +145,14 @@ func (x Field_Kind) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (Field_Kind) Type() protoreflect.EnumType {
+	return xxx_File_google_protobuf_type_proto_enumTypes[1]
+}
+
+func (x Field_Kind) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Use Field_Kind.Type instead.
 func (Field_Kind) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_type_proto_rawDescGZIP(), []int{1, 0}
@@ -170,13 +172,6 @@ const (
 	Field_CARDINALITY_REPEATED Field_Cardinality = 3
 )
 
-func (e Field_Cardinality) Type() protoreflect.EnumType {
-	return xxx_File_google_protobuf_type_proto_enumTypes[2]
-}
-func (e Field_Cardinality) Number() protoreflect.EnumNumber {
-	return protoreflect.EnumNumber(e)
-}
-
 // Deprecated: Use Field_Cardinality.Type.Values instead.
 var Field_Cardinality_name = map[int32]string{
 	0: "CARDINALITY_UNKNOWN",
@@ -197,6 +192,14 @@ func (x Field_Cardinality) String() string {
 	return protoimpl.X.EnumStringOf(x.Type(), protoreflect.EnumNumber(x))
 }
 
+func (Field_Cardinality) Type() protoreflect.EnumType {
+	return xxx_File_google_protobuf_type_proto_enumTypes[2]
+}
+
+func (x Field_Cardinality) Number() protoreflect.EnumNumber {
+	return protoreflect.EnumNumber(x)
+}
+
 // Deprecated: Use Field_Cardinality.Type instead.
 func (Field_Cardinality) EnumDescriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_type_proto_rawDescGZIP(), []int{1, 1}
@@ -221,56 +224,63 @@ type Type struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Type) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_type_proto_messageTypes[0].MessageOf(m)
+func (x *Type) Reset() {
+	*x = Type{}
+}
+
+func (x *Type) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Type) ProtoMessage() {}
+
+func (x *Type) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_type_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Type) Reset()         { *m = Type{} }
-func (m *Type) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Type) ProtoMessage()    {}
 
 // Deprecated: Use Type.ProtoReflect.Type instead.
 func (*Type) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_type_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *Type) GetName() string {
-	if m != nil {
-		return m.Name
+func (x *Type) GetName() string {
+	if x != nil {
+		return x.Name
 	}
 	return ""
 }
 
-func (m *Type) GetFields() []*Field {
-	if m != nil {
-		return m.Fields
+func (x *Type) GetFields() []*Field {
+	if x != nil {
+		return x.Fields
 	}
 	return nil
 }
 
-func (m *Type) GetOneofs() []string {
-	if m != nil {
-		return m.Oneofs
+func (x *Type) GetOneofs() []string {
+	if x != nil {
+		return x.Oneofs
 	}
 	return nil
 }
 
-func (m *Type) GetOptions() []*Option {
-	if m != nil {
-		return m.Options
+func (x *Type) GetOptions() []*Option {
+	if x != nil {
+		return x.Options
 	}
 	return nil
 }
 
-func (m *Type) GetSourceContext() *SourceContext {
-	if m != nil {
-		return m.SourceContext
+func (x *Type) GetSourceContext() *SourceContext {
+	if x != nil {
+		return x.SourceContext
 	}
 	return nil
 }
 
-func (m *Type) GetSyntax() Syntax {
-	if m != nil {
-		return m.Syntax
+func (x *Type) GetSyntax() Syntax {
+	if x != nil {
+		return x.Syntax
 	}
 	return Syntax_SYNTAX_PROTO2
 }
@@ -304,84 +314,91 @@ type Field struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Field) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_type_proto_messageTypes[1].MessageOf(m)
+func (x *Field) Reset() {
+	*x = Field{}
+}
+
+func (x *Field) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Field) ProtoMessage() {}
+
+func (x *Field) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_type_proto_messageTypes[1].MessageOf(x)
 }
-func (m *Field) Reset()         { *m = Field{} }
-func (m *Field) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Field) ProtoMessage()    {}
 
 // Deprecated: Use Field.ProtoReflect.Type instead.
 func (*Field) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_type_proto_rawDescGZIP(), []int{1}
 }
 
-func (m *Field) GetKind() Field_Kind {
-	if m != nil {
-		return m.Kind
+func (x *Field) GetKind() Field_Kind {
+	if x != nil {
+		return x.Kind
 	}
 	return Field_TYPE_UNKNOWN
 }
 
-func (m *Field) GetCardinality() Field_Cardinality {
-	if m != nil {
-		return m.Cardinality
+func (x *Field) GetCardinality() Field_Cardinality {
+	if x != nil {
+		return x.Cardinality
 	}
 	return Field_CARDINALITY_UNKNOWN
 }
 
-func (m *Field) GetNumber() int32 {
-	if m != nil {
-		return m.Number
+func (x *Field) GetNumber() int32 {
+	if x != nil {
+		return x.Number
 	}
 	return 0
 }
 
-func (m *Field) GetName() string {
-	if m != nil {
-		return m.Name
+func (x *Field) GetName() string {
+	if x != nil {
+		return x.Name
 	}
 	return ""
 }
 
-func (m *Field) GetTypeUrl() string {
-	if m != nil {
-		return m.TypeUrl
+func (x *Field) GetTypeUrl() string {
+	if x != nil {
+		return x.TypeUrl
 	}
 	return ""
 }
 
-func (m *Field) GetOneofIndex() int32 {
-	if m != nil {
-		return m.OneofIndex
+func (x *Field) GetOneofIndex() int32 {
+	if x != nil {
+		return x.OneofIndex
 	}
 	return 0
 }
 
-func (m *Field) GetPacked() bool {
-	if m != nil {
-		return m.Packed
+func (x *Field) GetPacked() bool {
+	if x != nil {
+		return x.Packed
 	}
 	return false
 }
 
-func (m *Field) GetOptions() []*Option {
-	if m != nil {
-		return m.Options
+func (x *Field) GetOptions() []*Option {
+	if x != nil {
+		return x.Options
 	}
 	return nil
 }
 
-func (m *Field) GetJsonName() string {
-	if m != nil {
-		return m.JsonName
+func (x *Field) GetJsonName() string {
+	if x != nil {
+		return x.JsonName
 	}
 	return ""
 }
 
-func (m *Field) GetDefaultValue() string {
-	if m != nil {
-		return m.DefaultValue
+func (x *Field) GetDefaultValue() string {
+	if x != nil {
+		return x.DefaultValue
 	}
 	return ""
 }
@@ -403,49 +420,56 @@ type Enum struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Enum) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_type_proto_messageTypes[2].MessageOf(m)
+func (x *Enum) Reset() {
+	*x = Enum{}
+}
+
+func (x *Enum) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Enum) ProtoMessage() {}
+
+func (x *Enum) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_type_proto_messageTypes[2].MessageOf(x)
 }
-func (m *Enum) Reset()         { *m = Enum{} }
-func (m *Enum) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Enum) ProtoMessage()    {}
 
 // Deprecated: Use Enum.ProtoReflect.Type instead.
 func (*Enum) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_type_proto_rawDescGZIP(), []int{2}
 }
 
-func (m *Enum) GetName() string {
-	if m != nil {
-		return m.Name
+func (x *Enum) GetName() string {
+	if x != nil {
+		return x.Name
 	}
 	return ""
 }
 
-func (m *Enum) GetEnumvalue() []*EnumValue {
-	if m != nil {
-		return m.Enumvalue
+func (x *Enum) GetEnumvalue() []*EnumValue {
+	if x != nil {
+		return x.Enumvalue
 	}
 	return nil
 }
 
-func (m *Enum) GetOptions() []*Option {
-	if m != nil {
-		return m.Options
+func (x *Enum) GetOptions() []*Option {
+	if x != nil {
+		return x.Options
 	}
 	return nil
 }
 
-func (m *Enum) GetSourceContext() *SourceContext {
-	if m != nil {
-		return m.SourceContext
+func (x *Enum) GetSourceContext() *SourceContext {
+	if x != nil {
+		return x.SourceContext
 	}
 	return nil
 }
 
-func (m *Enum) GetSyntax() Syntax {
-	if m != nil {
-		return m.Syntax
+func (x *Enum) GetSyntax() Syntax {
+	if x != nil {
+		return x.Syntax
 	}
 	return Syntax_SYNTAX_PROTO2
 }
@@ -463,35 +487,42 @@ type EnumValue struct {
 	XXX_sizecache        int32     `json:"-"`
 }
 
-func (m *EnumValue) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_type_proto_messageTypes[3].MessageOf(m)
+func (x *EnumValue) Reset() {
+	*x = EnumValue{}
+}
+
+func (x *EnumValue) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EnumValue) ProtoMessage() {}
+
+func (x *EnumValue) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_type_proto_messageTypes[3].MessageOf(x)
 }
-func (m *EnumValue) Reset()         { *m = EnumValue{} }
-func (m *EnumValue) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*EnumValue) ProtoMessage()    {}
 
 // Deprecated: Use EnumValue.ProtoReflect.Type instead.
 func (*EnumValue) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_type_proto_rawDescGZIP(), []int{3}
 }
 
-func (m *EnumValue) GetName() string {
-	if m != nil {
-		return m.Name
+func (x *EnumValue) GetName() string {
+	if x != nil {
+		return x.Name
 	}
 	return ""
 }
 
-func (m *EnumValue) GetNumber() int32 {
-	if m != nil {
-		return m.Number
+func (x *EnumValue) GetNumber() int32 {
+	if x != nil {
+		return x.Number
 	}
 	return 0
 }
 
-func (m *EnumValue) GetOptions() []*Option {
-	if m != nil {
-		return m.Options
+func (x *EnumValue) GetOptions() []*Option {
+	if x != nil {
+		return x.Options
 	}
 	return nil
 }
@@ -514,28 +545,35 @@ type Option struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Option) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_type_proto_messageTypes[4].MessageOf(m)
+func (x *Option) Reset() {
+	*x = Option{}
+}
+
+func (x *Option) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Option) ProtoMessage() {}
+
+func (x *Option) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_type_proto_messageTypes[4].MessageOf(x)
 }
-func (m *Option) Reset()         { *m = Option{} }
-func (m *Option) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Option) ProtoMessage()    {}
 
 // Deprecated: Use Option.ProtoReflect.Type instead.
 func (*Option) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_type_proto_rawDescGZIP(), []int{4}
 }
 
-func (m *Option) GetName() string {
-	if m != nil {
-		return m.Name
+func (x *Option) GetName() string {
+	if x != nil {
+		return x.Name
 	}
 	return ""
 }
 
-func (m *Option) GetValue() *Any {
-	if m != nil {
-		return m.Value
+func (x *Option) GetValue() *Any {
+	if x != nil {
+		return x.Value
 	}
 	return nil
 }

+ 135 - 72
types/known/wrappers.pb.go

@@ -23,12 +23,19 @@ type DoubleValue struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *DoubleValue) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_wrappers_proto_messageTypes[0].MessageOf(m)
+func (x *DoubleValue) Reset() {
+	*x = DoubleValue{}
+}
+
+func (x *DoubleValue) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DoubleValue) ProtoMessage() {}
+
+func (x *DoubleValue) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_wrappers_proto_messageTypes[0].MessageOf(x)
 }
-func (m *DoubleValue) Reset()         { *m = DoubleValue{} }
-func (m *DoubleValue) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*DoubleValue) ProtoMessage()    {}
 
 // Deprecated: Use DoubleValue.ProtoReflect.Type instead.
 func (*DoubleValue) Descriptor() ([]byte, []int) {
@@ -37,9 +44,9 @@ func (*DoubleValue) Descriptor() ([]byte, []int) {
 
 func (*DoubleValue) XXX_WellKnownType() string { return "DoubleValue" }
 
-func (m *DoubleValue) GetValue() float64 {
-	if m != nil {
-		return m.Value
+func (x *DoubleValue) GetValue() float64 {
+	if x != nil {
+		return x.Value
 	}
 	return 0
 }
@@ -55,12 +62,19 @@ type FloatValue struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *FloatValue) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_wrappers_proto_messageTypes[1].MessageOf(m)
+func (x *FloatValue) Reset() {
+	*x = FloatValue{}
+}
+
+func (x *FloatValue) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*FloatValue) ProtoMessage() {}
+
+func (x *FloatValue) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_wrappers_proto_messageTypes[1].MessageOf(x)
 }
-func (m *FloatValue) Reset()         { *m = FloatValue{} }
-func (m *FloatValue) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*FloatValue) ProtoMessage()    {}
 
 // Deprecated: Use FloatValue.ProtoReflect.Type instead.
 func (*FloatValue) Descriptor() ([]byte, []int) {
@@ -69,9 +83,9 @@ func (*FloatValue) Descriptor() ([]byte, []int) {
 
 func (*FloatValue) XXX_WellKnownType() string { return "FloatValue" }
 
-func (m *FloatValue) GetValue() float32 {
-	if m != nil {
-		return m.Value
+func (x *FloatValue) GetValue() float32 {
+	if x != nil {
+		return x.Value
 	}
 	return 0
 }
@@ -87,12 +101,19 @@ type Int64Value struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Int64Value) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_wrappers_proto_messageTypes[2].MessageOf(m)
+func (x *Int64Value) Reset() {
+	*x = Int64Value{}
+}
+
+func (x *Int64Value) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Int64Value) ProtoMessage() {}
+
+func (x *Int64Value) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_wrappers_proto_messageTypes[2].MessageOf(x)
 }
-func (m *Int64Value) Reset()         { *m = Int64Value{} }
-func (m *Int64Value) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Int64Value) ProtoMessage()    {}
 
 // Deprecated: Use Int64Value.ProtoReflect.Type instead.
 func (*Int64Value) Descriptor() ([]byte, []int) {
@@ -101,9 +122,9 @@ func (*Int64Value) Descriptor() ([]byte, []int) {
 
 func (*Int64Value) XXX_WellKnownType() string { return "Int64Value" }
 
-func (m *Int64Value) GetValue() int64 {
-	if m != nil {
-		return m.Value
+func (x *Int64Value) GetValue() int64 {
+	if x != nil {
+		return x.Value
 	}
 	return 0
 }
@@ -119,12 +140,19 @@ type UInt64Value struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *UInt64Value) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_wrappers_proto_messageTypes[3].MessageOf(m)
+func (x *UInt64Value) Reset() {
+	*x = UInt64Value{}
+}
+
+func (x *UInt64Value) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UInt64Value) ProtoMessage() {}
+
+func (x *UInt64Value) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_wrappers_proto_messageTypes[3].MessageOf(x)
 }
-func (m *UInt64Value) Reset()         { *m = UInt64Value{} }
-func (m *UInt64Value) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*UInt64Value) ProtoMessage()    {}
 
 // Deprecated: Use UInt64Value.ProtoReflect.Type instead.
 func (*UInt64Value) Descriptor() ([]byte, []int) {
@@ -133,9 +161,9 @@ func (*UInt64Value) Descriptor() ([]byte, []int) {
 
 func (*UInt64Value) XXX_WellKnownType() string { return "UInt64Value" }
 
-func (m *UInt64Value) GetValue() uint64 {
-	if m != nil {
-		return m.Value
+func (x *UInt64Value) GetValue() uint64 {
+	if x != nil {
+		return x.Value
 	}
 	return 0
 }
@@ -151,12 +179,19 @@ type Int32Value struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Int32Value) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_wrappers_proto_messageTypes[4].MessageOf(m)
+func (x *Int32Value) Reset() {
+	*x = Int32Value{}
+}
+
+func (x *Int32Value) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Int32Value) ProtoMessage() {}
+
+func (x *Int32Value) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_wrappers_proto_messageTypes[4].MessageOf(x)
 }
-func (m *Int32Value) Reset()         { *m = Int32Value{} }
-func (m *Int32Value) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Int32Value) ProtoMessage()    {}
 
 // Deprecated: Use Int32Value.ProtoReflect.Type instead.
 func (*Int32Value) Descriptor() ([]byte, []int) {
@@ -165,9 +200,9 @@ func (*Int32Value) Descriptor() ([]byte, []int) {
 
 func (*Int32Value) XXX_WellKnownType() string { return "Int32Value" }
 
-func (m *Int32Value) GetValue() int32 {
-	if m != nil {
-		return m.Value
+func (x *Int32Value) GetValue() int32 {
+	if x != nil {
+		return x.Value
 	}
 	return 0
 }
@@ -183,12 +218,19 @@ type UInt32Value struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *UInt32Value) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_wrappers_proto_messageTypes[5].MessageOf(m)
+func (x *UInt32Value) Reset() {
+	*x = UInt32Value{}
+}
+
+func (x *UInt32Value) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UInt32Value) ProtoMessage() {}
+
+func (x *UInt32Value) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_wrappers_proto_messageTypes[5].MessageOf(x)
 }
-func (m *UInt32Value) Reset()         { *m = UInt32Value{} }
-func (m *UInt32Value) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*UInt32Value) ProtoMessage()    {}
 
 // Deprecated: Use UInt32Value.ProtoReflect.Type instead.
 func (*UInt32Value) Descriptor() ([]byte, []int) {
@@ -197,9 +239,9 @@ func (*UInt32Value) Descriptor() ([]byte, []int) {
 
 func (*UInt32Value) XXX_WellKnownType() string { return "UInt32Value" }
 
-func (m *UInt32Value) GetValue() uint32 {
-	if m != nil {
-		return m.Value
+func (x *UInt32Value) GetValue() uint32 {
+	if x != nil {
+		return x.Value
 	}
 	return 0
 }
@@ -215,12 +257,19 @@ type BoolValue struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *BoolValue) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_wrappers_proto_messageTypes[6].MessageOf(m)
+func (x *BoolValue) Reset() {
+	*x = BoolValue{}
+}
+
+func (x *BoolValue) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BoolValue) ProtoMessage() {}
+
+func (x *BoolValue) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_wrappers_proto_messageTypes[6].MessageOf(x)
 }
-func (m *BoolValue) Reset()         { *m = BoolValue{} }
-func (m *BoolValue) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*BoolValue) ProtoMessage()    {}
 
 // Deprecated: Use BoolValue.ProtoReflect.Type instead.
 func (*BoolValue) Descriptor() ([]byte, []int) {
@@ -229,9 +278,9 @@ func (*BoolValue) Descriptor() ([]byte, []int) {
 
 func (*BoolValue) XXX_WellKnownType() string { return "BoolValue" }
 
-func (m *BoolValue) GetValue() bool {
-	if m != nil {
-		return m.Value
+func (x *BoolValue) GetValue() bool {
+	if x != nil {
+		return x.Value
 	}
 	return false
 }
@@ -247,12 +296,19 @@ type StringValue struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *StringValue) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_wrappers_proto_messageTypes[7].MessageOf(m)
+func (x *StringValue) Reset() {
+	*x = StringValue{}
+}
+
+func (x *StringValue) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*StringValue) ProtoMessage() {}
+
+func (x *StringValue) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_wrappers_proto_messageTypes[7].MessageOf(x)
 }
-func (m *StringValue) Reset()         { *m = StringValue{} }
-func (m *StringValue) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*StringValue) ProtoMessage()    {}
 
 // Deprecated: Use StringValue.ProtoReflect.Type instead.
 func (*StringValue) Descriptor() ([]byte, []int) {
@@ -261,9 +317,9 @@ func (*StringValue) Descriptor() ([]byte, []int) {
 
 func (*StringValue) XXX_WellKnownType() string { return "StringValue" }
 
-func (m *StringValue) GetValue() string {
-	if m != nil {
-		return m.Value
+func (x *StringValue) GetValue() string {
+	if x != nil {
+		return x.Value
 	}
 	return ""
 }
@@ -279,12 +335,19 @@ type BytesValue struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *BytesValue) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_wrappers_proto_messageTypes[8].MessageOf(m)
+func (x *BytesValue) Reset() {
+	*x = BytesValue{}
+}
+
+func (x *BytesValue) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BytesValue) ProtoMessage() {}
+
+func (x *BytesValue) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_wrappers_proto_messageTypes[8].MessageOf(x)
 }
-func (m *BytesValue) Reset()         { *m = BytesValue{} }
-func (m *BytesValue) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*BytesValue) ProtoMessage()    {}
 
 // Deprecated: Use BytesValue.ProtoReflect.Type instead.
 func (*BytesValue) Descriptor() ([]byte, []int) {
@@ -293,9 +356,9 @@ func (*BytesValue) Descriptor() ([]byte, []int) {
 
 func (*BytesValue) XXX_WellKnownType() string { return "BytesValue" }
 
-func (m *BytesValue) GetValue() []byte {
-	if m != nil {
-		return m.Value
+func (x *BytesValue) GetValue() []byte {
+	if x != nil {
+		return x.Value
 	}
 	return nil
 }

+ 87 - 59
types/plugin/plugin.pb.go

@@ -26,42 +26,49 @@ type Version struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *Version) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_compiler_plugin_proto_messageTypes[0].MessageOf(m)
+func (x *Version) Reset() {
+	*x = Version{}
+}
+
+func (x *Version) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Version) ProtoMessage() {}
+
+func (x *Version) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_compiler_plugin_proto_messageTypes[0].MessageOf(x)
 }
-func (m *Version) Reset()         { *m = Version{} }
-func (m *Version) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*Version) ProtoMessage()    {}
 
 // Deprecated: Use Version.ProtoReflect.Type instead.
 func (*Version) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_compiler_plugin_proto_rawDescGZIP(), []int{0}
 }
 
-func (m *Version) GetMajor() int32 {
-	if m != nil && m.Major != nil {
-		return *m.Major
+func (x *Version) GetMajor() int32 {
+	if x != nil && x.Major != nil {
+		return *x.Major
 	}
 	return 0
 }
 
-func (m *Version) GetMinor() int32 {
-	if m != nil && m.Minor != nil {
-		return *m.Minor
+func (x *Version) GetMinor() int32 {
+	if x != nil && x.Minor != nil {
+		return *x.Minor
 	}
 	return 0
 }
 
-func (m *Version) GetPatch() int32 {
-	if m != nil && m.Patch != nil {
-		return *m.Patch
+func (x *Version) GetPatch() int32 {
+	if x != nil && x.Patch != nil {
+		return *x.Patch
 	}
 	return 0
 }
 
-func (m *Version) GetSuffix() string {
-	if m != nil && m.Suffix != nil {
-		return *m.Suffix
+func (x *Version) GetSuffix() string {
+	if x != nil && x.Suffix != nil {
+		return *x.Suffix
 	}
 	return ""
 }
@@ -96,42 +103,49 @@ type CodeGeneratorRequest struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *CodeGeneratorRequest) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_compiler_plugin_proto_messageTypes[1].MessageOf(m)
+func (x *CodeGeneratorRequest) Reset() {
+	*x = CodeGeneratorRequest{}
+}
+
+func (x *CodeGeneratorRequest) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CodeGeneratorRequest) ProtoMessage() {}
+
+func (x *CodeGeneratorRequest) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_compiler_plugin_proto_messageTypes[1].MessageOf(x)
 }
-func (m *CodeGeneratorRequest) Reset()         { *m = CodeGeneratorRequest{} }
-func (m *CodeGeneratorRequest) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*CodeGeneratorRequest) ProtoMessage()    {}
 
 // Deprecated: Use CodeGeneratorRequest.ProtoReflect.Type instead.
 func (*CodeGeneratorRequest) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_compiler_plugin_proto_rawDescGZIP(), []int{1}
 }
 
-func (m *CodeGeneratorRequest) GetFileToGenerate() []string {
-	if m != nil {
-		return m.FileToGenerate
+func (x *CodeGeneratorRequest) GetFileToGenerate() []string {
+	if x != nil {
+		return x.FileToGenerate
 	}
 	return nil
 }
 
-func (m *CodeGeneratorRequest) GetParameter() string {
-	if m != nil && m.Parameter != nil {
-		return *m.Parameter
+func (x *CodeGeneratorRequest) GetParameter() string {
+	if x != nil && x.Parameter != nil {
+		return *x.Parameter
 	}
 	return ""
 }
 
-func (m *CodeGeneratorRequest) GetProtoFile() []*descriptor.FileDescriptorProto {
-	if m != nil {
-		return m.ProtoFile
+func (x *CodeGeneratorRequest) GetProtoFile() []*descriptor.FileDescriptorProto {
+	if x != nil {
+		return x.ProtoFile
 	}
 	return nil
 }
 
-func (m *CodeGeneratorRequest) GetCompilerVersion() *Version {
-	if m != nil {
-		return m.CompilerVersion
+func (x *CodeGeneratorRequest) GetCompilerVersion() *Version {
+	if x != nil {
+		return x.CompilerVersion
 	}
 	return nil
 }
@@ -153,28 +167,35 @@ type CodeGeneratorResponse struct {
 	XXX_sizecache        int32                         `json:"-"`
 }
 
-func (m *CodeGeneratorResponse) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_compiler_plugin_proto_messageTypes[2].MessageOf(m)
+func (x *CodeGeneratorResponse) Reset() {
+	*x = CodeGeneratorResponse{}
+}
+
+func (x *CodeGeneratorResponse) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CodeGeneratorResponse) ProtoMessage() {}
+
+func (x *CodeGeneratorResponse) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_compiler_plugin_proto_messageTypes[2].MessageOf(x)
 }
-func (m *CodeGeneratorResponse) Reset()         { *m = CodeGeneratorResponse{} }
-func (m *CodeGeneratorResponse) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*CodeGeneratorResponse) ProtoMessage()    {}
 
 // Deprecated: Use CodeGeneratorResponse.ProtoReflect.Type instead.
 func (*CodeGeneratorResponse) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_compiler_plugin_proto_rawDescGZIP(), []int{2}
 }
 
-func (m *CodeGeneratorResponse) GetError() string {
-	if m != nil && m.Error != nil {
-		return *m.Error
+func (x *CodeGeneratorResponse) GetError() string {
+	if x != nil && x.Error != nil {
+		return *x.Error
 	}
 	return ""
 }
 
-func (m *CodeGeneratorResponse) GetFile() []*CodeGeneratorResponse_File {
-	if m != nil {
-		return m.File
+func (x *CodeGeneratorResponse) GetFile() []*CodeGeneratorResponse_File {
+	if x != nil {
+		return x.File
 	}
 	return nil
 }
@@ -238,35 +259,42 @@ type CodeGeneratorResponse_File struct {
 	XXX_sizecache        int32    `json:"-"`
 }
 
-func (m *CodeGeneratorResponse_File) ProtoReflect() protoreflect.Message {
-	return xxx_File_google_protobuf_compiler_plugin_proto_messageTypes[3].MessageOf(m)
+func (x *CodeGeneratorResponse_File) Reset() {
+	*x = CodeGeneratorResponse_File{}
+}
+
+func (x *CodeGeneratorResponse_File) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CodeGeneratorResponse_File) ProtoMessage() {}
+
+func (x *CodeGeneratorResponse_File) ProtoReflect() protoreflect.Message {
+	return xxx_File_google_protobuf_compiler_plugin_proto_messageTypes[3].MessageOf(x)
 }
-func (m *CodeGeneratorResponse_File) Reset()         { *m = CodeGeneratorResponse_File{} }
-func (m *CodeGeneratorResponse_File) String() string { return protoimpl.X.MessageStringOf(m) }
-func (*CodeGeneratorResponse_File) ProtoMessage()    {}
 
 // Deprecated: Use CodeGeneratorResponse_File.ProtoReflect.Type instead.
 func (*CodeGeneratorResponse_File) Descriptor() ([]byte, []int) {
 	return xxx_File_google_protobuf_compiler_plugin_proto_rawDescGZIP(), []int{2, 0}
 }
 
-func (m *CodeGeneratorResponse_File) GetName() string {
-	if m != nil && m.Name != nil {
-		return *m.Name
+func (x *CodeGeneratorResponse_File) GetName() string {
+	if x != nil && x.Name != nil {
+		return *x.Name
 	}
 	return ""
 }
 
-func (m *CodeGeneratorResponse_File) GetInsertionPoint() string {
-	if m != nil && m.InsertionPoint != nil {
-		return *m.InsertionPoint
+func (x *CodeGeneratorResponse_File) GetInsertionPoint() string {
+	if x != nil && x.InsertionPoint != nil {
+		return *x.InsertionPoint
 	}
 	return ""
 }
 
-func (m *CodeGeneratorResponse_File) GetContent() string {
-	if m != nil && m.Content != nil {
-		return *m.Content
+func (x *CodeGeneratorResponse_File) GetContent() string {
+	if x != nil && x.Content != nil {
+		return *x.Content
 	}
 	return ""
 }

Некоторые файлы не были показаны из-за большого количества измененных файлов