proto, runtime/protoiface: add support for fast-path marshaling
Allow message implementations to provide optimized versions of standard
operations. Generated messages now include a ProtoReflectMethods method,
returning a protoiface.Methods struct containing pointers to assorted
optional functions.
The Methods struct also includes a Flags field indicating support for
optional features such as deterministic marshaling.
Implementation of the fast paths (and tests) will come in later CLs.
Change-Id: Idd1beed0ecf43ec5e5e7b8da2ee1e08d3ce32213
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/170340
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
diff --git a/cmd/protoc-gen-go/internal_gengo/reflect.go b/cmd/protoc-gen-go/internal_gengo/reflect.go
index 2d0a9ff..129a735 100644
--- a/cmd/protoc-gen-go/internal_gengo/reflect.go
+++ b/cmd/protoc-gen-go/internal_gengo/reflect.go
@@ -265,6 +265,9 @@
g.P("return ", typesVar, "[", idx, "].MessageOf(x)")
g.P("}")
g.P()
+ g.P("func (m *", message.GoIdent, ") XXX_Methods() *", protoifacePackage.Ident("Methods"), " {")
+ g.P("return ", typesVar, "[", idx, "].Methods()")
+ g.P("}")
}
func rawDescVarName(f *fileInfo) string {
diff --git a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go
index e4e3e06..b5e3701 100644
--- a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go
+++ b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -80,6 +81,10 @@
return xxx_File_annotations_annotations_proto_messageTypes[0].MessageOf(x)
}
+func (m *AnnotationsTestMessage) XXX_Methods() *protoiface.Methods {
+ return xxx_File_annotations_annotations_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use AnnotationsTestMessage.ProtoReflect.Type instead.
func (*AnnotationsTestMessage) Descriptor() ([]byte, []int) {
return xxx_File_annotations_annotations_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta
index a0f0199..2db1eff 100644
--- a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta
+++ b/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: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}
\ No newline at end of file
+annotation:{path:5 path:0 source_file:"annotations/annotations.proto" begin:461 end:480} annotation:{path:5 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:497 end:544} annotation:{path:4 path:0 source_file:"annotations/annotations.proto" begin:1702 end:1724} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:1735 end:1755} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:2736 end:2759}
\ No newline at end of file
diff --git a/cmd/protoc-gen-go/testdata/comments/comments.pb.go b/cmd/protoc-gen-go/testdata/comments/comments.pb.go
index 48a847e..4f973b2 100644
--- a/cmd/protoc-gen-go/testdata/comments/comments.pb.go
+++ b/cmd/protoc-gen-go/testdata/comments/comments.pb.go
@@ -8,6 +8,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -43,6 +44,10 @@
return xxx_File_comments_comments_proto_messageTypes[0].MessageOf(x)
}
+func (m *Message1) XXX_Methods() *protoiface.Methods {
+ return xxx_File_comments_comments_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use Message1.ProtoReflect.Type instead.
func (*Message1) Descriptor() ([]byte, []int) {
return xxx_File_comments_comments_proto_rawDescGZIP(), []int{0}
@@ -107,6 +112,10 @@
return xxx_File_comments_comments_proto_messageTypes[1].MessageOf(x)
}
+func (m *Message2) XXX_Methods() *protoiface.Methods {
+ return xxx_File_comments_comments_proto_messageTypes[1].Methods()
+}
+
// Deprecated: Use Message2.ProtoReflect.Type instead.
func (*Message2) Descriptor() ([]byte, []int) {
return xxx_File_comments_comments_proto_rawDescGZIP(), []int{1}
@@ -133,6 +142,10 @@
return xxx_File_comments_comments_proto_messageTypes[2].MessageOf(x)
}
+func (m *Message1_Message1A) XXX_Methods() *protoiface.Methods {
+ return xxx_File_comments_comments_proto_messageTypes[2].Methods()
+}
+
// Deprecated: Use Message1_Message1A.ProtoReflect.Type instead.
func (*Message1_Message1A) Descriptor() ([]byte, []int) {
return xxx_File_comments_comments_proto_rawDescGZIP(), []int{0, 0}
@@ -159,6 +172,10 @@
return xxx_File_comments_comments_proto_messageTypes[3].MessageOf(x)
}
+func (m *Message1_Message1B) XXX_Methods() *protoiface.Methods {
+ return xxx_File_comments_comments_proto_messageTypes[3].Methods()
+}
+
// Deprecated: Use Message1_Message1B.ProtoReflect.Type instead.
func (*Message1_Message1B) Descriptor() ([]byte, []int) {
return xxx_File_comments_comments_proto_rawDescGZIP(), []int{0, 1}
@@ -185,6 +202,10 @@
return xxx_File_comments_comments_proto_messageTypes[4].MessageOf(x)
}
+func (m *Message2_Message2A) XXX_Methods() *protoiface.Methods {
+ return xxx_File_comments_comments_proto_messageTypes[4].Methods()
+}
+
// Deprecated: Use Message2_Message2A.ProtoReflect.Type instead.
func (*Message2_Message2A) Descriptor() ([]byte, []int) {
return xxx_File_comments_comments_proto_rawDescGZIP(), []int{1, 0}
@@ -211,6 +232,10 @@
return xxx_File_comments_comments_proto_messageTypes[5].MessageOf(x)
}
+func (m *Message2_Message2B) XXX_Methods() *protoiface.Methods {
+ return xxx_File_comments_comments_proto_messageTypes[5].Methods()
+}
+
// Deprecated: Use Message2_Message2B.ProtoReflect.Type instead.
func (*Message2_Message2B) Descriptor() ([]byte, []int) {
return xxx_File_comments_comments_proto_rawDescGZIP(), []int{1, 1}
diff --git a/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go b/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go
index 19721de..f30e424 100644
--- a/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go
+++ b/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -66,6 +67,10 @@
return xxx_File_comments_deprecated_proto_messageTypes[0].MessageOf(x)
}
+func (m *DeprecatedMessage) XXX_Methods() *protoiface.Methods {
+ return xxx_File_comments_deprecated_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use DeprecatedMessage.ProtoReflect.Type instead.
func (*DeprecatedMessage) Descriptor() ([]byte, []int) {
return xxx_File_comments_deprecated_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go b/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go
index 17e4bd6..b53d3dc 100644
--- a/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go
+++ b/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go
@@ -35,6 +35,10 @@
return xxx_File_extensions_base_base_proto_messageTypes[0].MessageOf(x)
}
+func (m *BaseMessage) XXX_Methods() *protoiface.Methods {
+ return xxx_File_extensions_base_base_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use BaseMessage.ProtoReflect.Type instead.
func (*BaseMessage) Descriptor() ([]byte, []int) {
return xxx_File_extensions_base_base_proto_rawDescGZIP(), []int{0}
@@ -78,6 +82,10 @@
return xxx_File_extensions_base_base_proto_messageTypes[1].MessageOf(x)
}
+func (m *MessageSetWireFormatMessage) XXX_Methods() *protoiface.Methods {
+ return xxx_File_extensions_base_base_proto_messageTypes[1].Methods()
+}
+
// Deprecated: Use MessageSetWireFormatMessage.ProtoReflect.Type instead.
func (*MessageSetWireFormatMessage) Descriptor() ([]byte, []int) {
return xxx_File_extensions_base_base_proto_rawDescGZIP(), []int{1}
diff --git a/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go b/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go
index 8ff2821..2267480 100644
--- a/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go
+++ b/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go
@@ -83,6 +83,10 @@
return xxx_File_extensions_ext_ext_proto_messageTypes[0].MessageOf(x)
}
+func (m *Message) XXX_Methods() *protoiface.Methods {
+ return xxx_File_extensions_ext_ext_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use Message.ProtoReflect.Type instead.
func (*Message) Descriptor() ([]byte, []int) {
return xxx_File_extensions_ext_ext_proto_rawDescGZIP(), []int{0}
@@ -116,6 +120,10 @@
return xxx_File_extensions_ext_ext_proto_messageTypes[1].MessageOf(x)
}
+func (m *ExtensionGroup) XXX_Methods() *protoiface.Methods {
+ return xxx_File_extensions_ext_ext_proto_messageTypes[1].Methods()
+}
+
// Deprecated: Use ExtensionGroup.ProtoReflect.Type instead.
func (*ExtensionGroup) Descriptor() ([]byte, []int) {
return xxx_File_extensions_ext_ext_proto_rawDescGZIP(), []int{1}
@@ -149,6 +157,10 @@
return xxx_File_extensions_ext_ext_proto_messageTypes[2].MessageOf(x)
}
+func (m *ExtendingMessage) XXX_Methods() *protoiface.Methods {
+ return xxx_File_extensions_ext_ext_proto_messageTypes[2].Methods()
+}
+
// Deprecated: Use ExtendingMessage.ProtoReflect.Type instead.
func (*ExtendingMessage) Descriptor() ([]byte, []int) {
return xxx_File_extensions_ext_ext_proto_rawDescGZIP(), []int{2}
@@ -175,6 +187,10 @@
return xxx_File_extensions_ext_ext_proto_messageTypes[3].MessageOf(x)
}
+func (m *RepeatedGroup) XXX_Methods() *protoiface.Methods {
+ return xxx_File_extensions_ext_ext_proto_messageTypes[3].Methods()
+}
+
// Deprecated: Use RepeatedGroup.ProtoReflect.Type instead.
func (*RepeatedGroup) Descriptor() ([]byte, []int) {
return xxx_File_extensions_ext_ext_proto_rawDescGZIP(), []int{3}
@@ -209,6 +225,10 @@
return xxx_File_extensions_ext_ext_proto_messageTypes[4].MessageOf(x)
}
+func (m *Extendable) XXX_Methods() *protoiface.Methods {
+ return xxx_File_extensions_ext_ext_proto_messageTypes[4].Methods()
+}
+
// Deprecated: Use Extendable.ProtoReflect.Type instead.
func (*Extendable) Descriptor() ([]byte, []int) {
return xxx_File_extensions_ext_ext_proto_rawDescGZIP(), []int{4}
@@ -244,6 +264,10 @@
return xxx_File_extensions_ext_ext_proto_messageTypes[5].MessageOf(x)
}
+func (m *MessageSetWireFormatExtension) XXX_Methods() *protoiface.Methods {
+ return xxx_File_extensions_ext_ext_proto_messageTypes[5].Methods()
+}
+
// Deprecated: Use MessageSetWireFormatExtension.ProtoReflect.Type instead.
func (*MessageSetWireFormatExtension) Descriptor() ([]byte, []int) {
return xxx_File_extensions_ext_ext_proto_rawDescGZIP(), []int{5}
@@ -269,6 +293,10 @@
return xxx_File_extensions_ext_ext_proto_messageTypes[6].MessageOf(x)
}
+func (m *Message_M) XXX_Methods() *protoiface.Methods {
+ return xxx_File_extensions_ext_ext_proto_messageTypes[6].Methods()
+}
+
// Deprecated: Use Message_M.ProtoReflect.Type instead.
func (*Message_M) Descriptor() ([]byte, []int) {
return xxx_File_extensions_ext_ext_proto_rawDescGZIP(), []int{0, 0}
@@ -294,6 +322,10 @@
return xxx_File_extensions_ext_ext_proto_messageTypes[7].MessageOf(x)
}
+func (m *ExtendingMessage_ExtendingMessageSubmessage) XXX_Methods() *protoiface.Methods {
+ return xxx_File_extensions_ext_ext_proto_messageTypes[7].Methods()
+}
+
// Deprecated: Use ExtendingMessage_ExtendingMessageSubmessage.ProtoReflect.Type instead.
func (*ExtendingMessage_ExtendingMessageSubmessage) Descriptor() ([]byte, []int) {
return xxx_File_extensions_ext_ext_proto_rawDescGZIP(), []int{2, 0}
diff --git a/cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go b/cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go
index ef84692..e8367a6 100644
--- a/cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go
+++ b/cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -33,6 +34,10 @@
return xxx_File_extensions_extra_extra_proto_messageTypes[0].MessageOf(x)
}
+func (m *ExtraMessage) XXX_Methods() *protoiface.Methods {
+ return xxx_File_extensions_extra_extra_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use ExtraMessage.ProtoReflect.Type instead.
func (*ExtraMessage) Descriptor() ([]byte, []int) {
return xxx_File_extensions_extra_extra_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go b/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go
index e8d218c..4aac7fb 100644
--- a/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go
+++ b/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go
@@ -67,6 +67,10 @@
return xxx_File_extensions_proto3_ext3_proto_messageTypes[0].MessageOf(x)
}
+func (m *Message) XXX_Methods() *protoiface.Methods {
+ return xxx_File_extensions_proto3_ext3_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use Message.ProtoReflect.Type instead.
func (*Message) Descriptor() ([]byte, []int) {
return xxx_File_extensions_proto3_ext3_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go b/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go
index cf6cca5..b8832bd 100644
--- a/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go
+++ b/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -71,6 +72,10 @@
return xxx_File_fieldnames_fieldnames_proto_messageTypes[0].MessageOf(x)
}
+func (m *Message) XXX_Methods() *protoiface.Methods {
+ return xxx_File_fieldnames_fieldnames_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use Message.ProtoReflect.Type instead.
func (*Message) Descriptor() ([]byte, []int) {
return xxx_File_fieldnames_fieldnames_proto_rawDescGZIP(), []int{0}
@@ -289,6 +294,10 @@
return xxx_File_fieldnames_fieldnames_proto_messageTypes[1].MessageOf(x)
}
+func (m *Message_OneofMessageConflict) XXX_Methods() *protoiface.Methods {
+ return xxx_File_fieldnames_fieldnames_proto_messageTypes[1].Methods()
+}
+
// Deprecated: Use Message_OneofMessageConflict.ProtoReflect.Type instead.
func (*Message_OneofMessageConflict) Descriptor() ([]byte, []int) {
return xxx_File_fieldnames_fieldnames_proto_rawDescGZIP(), []int{0, 0}
diff --git a/cmd/protoc-gen-go/testdata/import_public/a.pb.go b/cmd/protoc-gen-go/testdata/import_public/a.pb.go
index af81fce..d527901 100644
--- a/cmd/protoc-gen-go/testdata/import_public/a.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/a.pb.go
@@ -8,6 +8,7 @@
sub2 "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/import_public/sub2"
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -79,6 +80,10 @@
return xxx_File_import_public_a_proto_messageTypes[0].MessageOf(x)
}
+func (m *Public) XXX_Methods() *protoiface.Methods {
+ return xxx_File_import_public_a_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use Public.ProtoReflect.Type instead.
func (*Public) Descriptor() ([]byte, []int) {
return xxx_File_import_public_a_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/import_public/b.pb.go b/cmd/protoc-gen-go/testdata/import_public/b.pb.go
index 5dcf793..8cd06e7 100644
--- a/cmd/protoc-gen-go/testdata/import_public/b.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/b.pb.go
@@ -7,6 +7,7 @@
sub "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/import_public/sub"
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -35,6 +36,10 @@
return xxx_File_import_public_b_proto_messageTypes[0].MessageOf(x)
}
+func (m *Local) XXX_Methods() *protoiface.Methods {
+ return xxx_File_import_public_b_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use Local.ProtoReflect.Type instead.
func (*Local) Descriptor() ([]byte, []int) {
return xxx_File_import_public_b_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go b/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
index 1a94137..053bfb0 100644
--- a/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
@@ -190,6 +190,10 @@
return xxx_File_import_public_sub_a_proto_messageTypes[0].MessageOf(x)
}
+func (m *M) XXX_Methods() *protoiface.Methods {
+ return xxx_File_import_public_sub_a_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use M.ProtoReflect.Type instead.
func (*M) Descriptor() ([]byte, []int) {
return xxx_File_import_public_sub_a_proto_rawDescGZIP(), []int{0}
@@ -306,6 +310,10 @@
return xxx_File_import_public_sub_a_proto_messageTypes[1].MessageOf(x)
}
+func (m *M_Submessage) XXX_Methods() *protoiface.Methods {
+ return xxx_File_import_public_sub_a_proto_messageTypes[1].Methods()
+}
+
// Deprecated: Use M_Submessage.ProtoReflect.Type instead.
func (*M_Submessage) Descriptor() ([]byte, []int) {
return xxx_File_import_public_sub_a_proto_rawDescGZIP(), []int{0, 0}
diff --git a/cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go b/cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go
index bbb09bf..da7e13f 100644
--- a/cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -32,6 +33,10 @@
return xxx_File_import_public_sub_b_proto_messageTypes[0].MessageOf(x)
}
+func (m *M2) XXX_Methods() *protoiface.Methods {
+ return xxx_File_import_public_sub_b_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use M2.ProtoReflect.Type instead.
func (*M2) Descriptor() ([]byte, []int) {
return xxx_File_import_public_sub_b_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go b/cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go
index be37da4..1061cda 100644
--- a/cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -32,6 +33,10 @@
return xxx_File_import_public_sub2_a_proto_messageTypes[0].MessageOf(x)
}
+func (m *Sub2Message) XXX_Methods() *protoiface.Methods {
+ return xxx_File_import_public_sub2_a_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use Sub2Message.ProtoReflect.Type instead.
func (*Sub2Message) Descriptor() ([]byte, []int) {
return xxx_File_import_public_sub2_a_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go b/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go
index 1ad7e8d..bcbf842 100644
--- a/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -32,6 +33,10 @@
return xxx_File_imports_fmt_m_proto_messageTypes[0].MessageOf(x)
}
+func (m *M) XXX_Methods() *protoiface.Methods {
+ return xxx_File_imports_fmt_m_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use M.ProtoReflect.Type instead.
func (*M) Descriptor() ([]byte, []int) {
return xxx_File_imports_fmt_m_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go b/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
index 8f1cb2c..0a431cc 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -65,6 +66,10 @@
return xxx_File_imports_test_a_1_m1_proto_messageTypes[0].MessageOf(x)
}
+func (m *M1) XXX_Methods() *protoiface.Methods {
+ return xxx_File_imports_test_a_1_m1_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use M1.ProtoReflect.Type instead.
func (*M1) Descriptor() ([]byte, []int) {
return xxx_File_imports_test_a_1_m1_proto_rawDescGZIP(), []int{0}
@@ -91,6 +96,10 @@
return xxx_File_imports_test_a_1_m1_proto_messageTypes[1].MessageOf(x)
}
+func (m *M1_1) XXX_Methods() *protoiface.Methods {
+ return xxx_File_imports_test_a_1_m1_proto_messageTypes[1].Methods()
+}
+
// 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}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go b/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go
index f822333..32fd4cd 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -32,6 +33,10 @@
return xxx_File_imports_test_a_1_m2_proto_messageTypes[0].MessageOf(x)
}
+func (m *M2) XXX_Methods() *protoiface.Methods {
+ return xxx_File_imports_test_a_1_m2_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use M2.ProtoReflect.Type instead.
func (*M2) Descriptor() ([]byte, []int) {
return xxx_File_imports_test_a_1_m2_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go b/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go
index 9eda985..42d38fc 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -32,6 +33,10 @@
return xxx_File_imports_test_a_2_m3_proto_messageTypes[0].MessageOf(x)
}
+func (m *M3) XXX_Methods() *protoiface.Methods {
+ return xxx_File_imports_test_a_2_m3_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use M3.ProtoReflect.Type instead.
func (*M3) Descriptor() ([]byte, []int) {
return xxx_File_imports_test_a_2_m3_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go b/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go
index d9eb9d4..4c83df3 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -32,6 +33,10 @@
return xxx_File_imports_test_a_2_m4_proto_messageTypes[0].MessageOf(x)
}
+func (m *M4) XXX_Methods() *protoiface.Methods {
+ return xxx_File_imports_test_a_2_m4_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use M4.ProtoReflect.Type instead.
func (*M4) Descriptor() ([]byte, []int) {
return xxx_File_imports_test_a_2_m4_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go b/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go
index 4f8f37e..c5bf4d8 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -32,6 +33,10 @@
return xxx_File_imports_test_b_1_m1_proto_messageTypes[0].MessageOf(x)
}
+func (m *M1) XXX_Methods() *protoiface.Methods {
+ return xxx_File_imports_test_b_1_m1_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use M1.ProtoReflect.Type instead.
func (*M1) Descriptor() ([]byte, []int) {
return xxx_File_imports_test_b_1_m1_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go b/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go
index 6da5dfb..bd2f632 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -32,6 +33,10 @@
return xxx_File_imports_test_b_1_m2_proto_messageTypes[0].MessageOf(x)
}
+func (m *M2) XXX_Methods() *protoiface.Methods {
+ return xxx_File_imports_test_b_1_m2_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use M2.ProtoReflect.Type instead.
func (*M2) Descriptor() ([]byte, []int) {
return xxx_File_imports_test_b_1_m2_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go b/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go
index 3022393..b29d33d 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go
@@ -7,6 +7,7 @@
test_a_1 "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/imports/test_a_1"
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -34,6 +35,10 @@
return xxx_File_imports_test_import_a1m1_proto_messageTypes[0].MessageOf(x)
}
+func (m *A1M1) XXX_Methods() *protoiface.Methods {
+ return xxx_File_imports_test_import_a1m1_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use A1M1.ProtoReflect.Type instead.
func (*A1M1) Descriptor() ([]byte, []int) {
return xxx_File_imports_test_import_a1m1_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go b/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go
index b2c5d85..a819ff1 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go
@@ -7,6 +7,7 @@
test_a_1 "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/imports/test_a_1"
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -34,6 +35,10 @@
return xxx_File_imports_test_import_a1m2_proto_messageTypes[0].MessageOf(x)
}
+func (m *A1M2) XXX_Methods() *protoiface.Methods {
+ return xxx_File_imports_test_import_a1m2_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use A1M2.ProtoReflect.Type instead.
func (*A1M2) Descriptor() ([]byte, []int) {
return xxx_File_imports_test_import_a1m2_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go b/cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go
index ff1fd2f..e6bde82 100644
--- a/cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go
+++ b/cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go
@@ -10,6 +10,7 @@
test_b_1 "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/imports/test_b_1"
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -41,6 +42,10 @@
return xxx_File_imports_test_import_all_proto_messageTypes[0].MessageOf(x)
}
+func (m *All) XXX_Methods() *protoiface.Methods {
+ return xxx_File_imports_test_import_all_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use All.ProtoReflect.Type instead.
func (*All) Descriptor() ([]byte, []int) {
return xxx_File_imports_test_import_all_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go b/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go
index b2826bd..36cc583 100644
--- a/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go
+++ b/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -35,6 +36,10 @@
return xxx_File_issue780_oneof_conflict_test_proto_messageTypes[0].MessageOf(x)
}
+func (m *Foo) XXX_Methods() *protoiface.Methods {
+ return xxx_File_issue780_oneof_conflict_test_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use Foo.ProtoReflect.Type instead.
func (*Foo) Descriptor() ([]byte, []int) {
return xxx_File_issue780_oneof_conflict_test_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go b/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go
index 829a1b6..75f0eac 100644
--- a/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go
+++ b/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -81,6 +82,10 @@
return xxx_File_nopackage_nopackage_proto_messageTypes[0].MessageOf(x)
}
+func (m *Message) XXX_Methods() *protoiface.Methods {
+ return xxx_File_nopackage_nopackage_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use Message.ProtoReflect.Type instead.
func (*Message) Descriptor() ([]byte, []int) {
return xxx_File_nopackage_nopackage_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/proto2/enum.pb.go b/cmd/protoc-gen-go/testdata/proto2/enum.pb.go
index ca359dd..eb0e87b 100644
--- a/cmd/protoc-gen-go/testdata/proto2/enum.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto2/enum.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -329,6 +330,10 @@
return xxx_File_proto2_enum_proto_messageTypes[0].MessageOf(x)
}
+func (m *EnumContainerMessage1) XXX_Methods() *protoiface.Methods {
+ return xxx_File_proto2_enum_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use EnumContainerMessage1.ProtoReflect.Type instead.
func (*EnumContainerMessage1) Descriptor() ([]byte, []int) {
return xxx_File_proto2_enum_proto_rawDescGZIP(), []int{0}
@@ -371,6 +376,10 @@
return xxx_File_proto2_enum_proto_messageTypes[1].MessageOf(x)
}
+func (m *EnumContainerMessage1_EnumContainerMessage2) XXX_Methods() *protoiface.Methods {
+ return xxx_File_proto2_enum_proto_messageTypes[1].Methods()
+}
+
// Deprecated: Use EnumContainerMessage1_EnumContainerMessage2.ProtoReflect.Type instead.
func (*EnumContainerMessage1_EnumContainerMessage2) Descriptor() ([]byte, []int) {
return xxx_File_proto2_enum_proto_rawDescGZIP(), []int{0, 0}
diff --git a/cmd/protoc-gen-go/testdata/proto2/fields.pb.go b/cmd/protoc-gen-go/testdata/proto2/fields.pb.go
index da2f13a..6906ece 100644
--- a/cmd/protoc-gen-go/testdata/proto2/fields.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto2/fields.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
math "math"
sync "sync"
@@ -189,6 +190,10 @@
return xxx_File_proto2_fields_proto_messageTypes[0].MessageOf(x)
}
+func (m *FieldTestMessage) XXX_Methods() *protoiface.Methods {
+ return xxx_File_proto2_fields_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use FieldTestMessage.ProtoReflect.Type instead.
func (*FieldTestMessage) Descriptor() ([]byte, []int) {
return xxx_File_proto2_fields_proto_rawDescGZIP(), []int{0}
@@ -1132,6 +1137,10 @@
return xxx_File_proto2_fields_proto_messageTypes[1].MessageOf(x)
}
+func (m *FieldTestMessage_OptionalGroup) XXX_Methods() *protoiface.Methods {
+ return xxx_File_proto2_fields_proto_messageTypes[1].Methods()
+}
+
// Deprecated: Use FieldTestMessage_OptionalGroup.ProtoReflect.Type instead.
func (*FieldTestMessage_OptionalGroup) Descriptor() ([]byte, []int) {
return xxx_File_proto2_fields_proto_rawDescGZIP(), []int{0, 0}
@@ -1165,6 +1174,10 @@
return xxx_File_proto2_fields_proto_messageTypes[2].MessageOf(x)
}
+func (m *FieldTestMessage_RequiredGroup) XXX_Methods() *protoiface.Methods {
+ return xxx_File_proto2_fields_proto_messageTypes[2].Methods()
+}
+
// Deprecated: Use FieldTestMessage_RequiredGroup.ProtoReflect.Type instead.
func (*FieldTestMessage_RequiredGroup) Descriptor() ([]byte, []int) {
return xxx_File_proto2_fields_proto_rawDescGZIP(), []int{0, 1}
@@ -1198,6 +1211,10 @@
return xxx_File_proto2_fields_proto_messageTypes[3].MessageOf(x)
}
+func (m *FieldTestMessage_RepeatedGroup) XXX_Methods() *protoiface.Methods {
+ return xxx_File_proto2_fields_proto_messageTypes[3].Methods()
+}
+
// Deprecated: Use FieldTestMessage_RepeatedGroup.ProtoReflect.Type instead.
func (*FieldTestMessage_RepeatedGroup) Descriptor() ([]byte, []int) {
return xxx_File_proto2_fields_proto_rawDescGZIP(), []int{0, 2}
@@ -1231,6 +1248,10 @@
return xxx_File_proto2_fields_proto_messageTypes[7].MessageOf(x)
}
+func (m *FieldTestMessage_OneofGroup) XXX_Methods() *protoiface.Methods {
+ return xxx_File_proto2_fields_proto_messageTypes[7].Methods()
+}
+
// Deprecated: Use FieldTestMessage_OneofGroup.ProtoReflect.Type instead.
func (*FieldTestMessage_OneofGroup) Descriptor() ([]byte, []int) {
return xxx_File_proto2_fields_proto_rawDescGZIP(), []int{0, 6}
@@ -1263,6 +1284,10 @@
return xxx_File_proto2_fields_proto_messageTypes[8].MessageOf(x)
}
+func (m *FieldTestMessage_Message) XXX_Methods() *protoiface.Methods {
+ return xxx_File_proto2_fields_proto_messageTypes[8].Methods()
+}
+
// Deprecated: Use FieldTestMessage_Message.ProtoReflect.Type instead.
func (*FieldTestMessage_Message) Descriptor() ([]byte, []int) {
return xxx_File_proto2_fields_proto_rawDescGZIP(), []int{0, 7}
diff --git a/cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go b/cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go
index c9b2e46..6a2227a 100644
--- a/cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -34,6 +35,10 @@
return xxx_File_proto2_nested_messages_proto_messageTypes[0].MessageOf(x)
}
+func (m *Layer1) XXX_Methods() *protoiface.Methods {
+ return xxx_File_proto2_nested_messages_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use Layer1.ProtoReflect.Type instead.
func (*Layer1) Descriptor() ([]byte, []int) {
return xxx_File_proto2_nested_messages_proto_rawDescGZIP(), []int{0}
@@ -74,6 +79,10 @@
return xxx_File_proto2_nested_messages_proto_messageTypes[1].MessageOf(x)
}
+func (m *Layer1_Layer2) XXX_Methods() *protoiface.Methods {
+ return xxx_File_proto2_nested_messages_proto_messageTypes[1].Methods()
+}
+
// Deprecated: Use Layer1_Layer2.ProtoReflect.Type instead.
func (*Layer1_Layer2) Descriptor() ([]byte, []int) {
return xxx_File_proto2_nested_messages_proto_rawDescGZIP(), []int{0, 0}
@@ -106,6 +115,10 @@
return xxx_File_proto2_nested_messages_proto_messageTypes[2].MessageOf(x)
}
+func (m *Layer1_Layer2_Layer3) XXX_Methods() *protoiface.Methods {
+ return xxx_File_proto2_nested_messages_proto_messageTypes[2].Methods()
+}
+
// Deprecated: Use Layer1_Layer2_Layer3.ProtoReflect.Type instead.
func (*Layer1_Layer2_Layer3) Descriptor() ([]byte, []int) {
return xxx_File_proto2_nested_messages_proto_rawDescGZIP(), []int{0, 0, 0}
diff --git a/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go b/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go
index 2ac0ff1..fa6458d 100644
--- a/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -34,6 +35,10 @@
return xxx_File_proto2_proto2_proto_messageTypes[0].MessageOf(x)
}
+func (m *Message) XXX_Methods() *protoiface.Methods {
+ return xxx_File_proto2_proto2_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use Message.ProtoReflect.Type instead.
func (*Message) Descriptor() ([]byte, []int) {
return xxx_File_proto2_proto2_proto_rawDescGZIP(), []int{0}
diff --git a/cmd/protoc-gen-go/testdata/proto3/fields.pb.go b/cmd/protoc-gen-go/testdata/proto3/fields.pb.go
index 8cb68f6..058ada4 100644
--- a/cmd/protoc-gen-go/testdata/proto3/fields.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto3/fields.pb.go
@@ -6,6 +6,7 @@
import (
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
+ protoiface "github.com/golang/protobuf/v2/runtime/protoiface"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
sync "sync"
)
@@ -102,6 +103,10 @@
return xxx_File_proto3_fields_proto_messageTypes[0].MessageOf(x)
}
+func (m *FieldTestMessage) XXX_Methods() *protoiface.Methods {
+ return xxx_File_proto3_fields_proto_messageTypes[0].Methods()
+}
+
// Deprecated: Use FieldTestMessage.ProtoReflect.Type instead.
func (*FieldTestMessage) Descriptor() ([]byte, []int) {
return xxx_File_proto3_fields_proto_rawDescGZIP(), []int{0}
@@ -386,6 +391,10 @@
return xxx_File_proto3_fields_proto_messageTypes[4].MessageOf(x)
}
+func (m *FieldTestMessage_Message) XXX_Methods() *protoiface.Methods {
+ return xxx_File_proto3_fields_proto_messageTypes[4].Methods()
+}
+
// Deprecated: Use FieldTestMessage_Message.ProtoReflect.Type instead.
func (*FieldTestMessage_Message) Descriptor() ([]byte, []int) {
return xxx_File_proto3_fields_proto_rawDescGZIP(), []int{0, 3}