cmd/protoc-gen-go: generate for v2-only dependencies
This removes yet another set of dependencies of v2 on v1.
The only remaining dependency are in the _test.go files,
primarily for proto.Equal.
Changes made:
* cmd/protoc-gen-go no longer generates any functionality that depends
on the v1 package, and instead only depends on v2.
* internal/fileinit.FileBuilder.MessageOutputTypes is switched from
protoreflect.MessageType to protoimpl.MessageType since the
implementation must be fully inialized before registration occurs.
* The test for internal/legacy/file_test.go is switched to a legacy_test
package to avoid a cyclic dependency.
This requires Load{Enum,Message,File}Desc to be exported.
Change-Id: I43e2fe64cff4eea204258ce11e791aca5eb6e569
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/169298
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/internal/testprotos/conformance/conformance.pb.go b/internal/testprotos/conformance/conformance.pb.go
index e70227d..b351f4c 100644
--- a/internal/testprotos/conformance/conformance.pb.go
+++ b/internal/testprotos/conformance/conformance.pb.go
@@ -4,10 +4,9 @@
package conformance_proto
import (
- proto "github.com/golang/protobuf/proto"
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
+ protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
- reflect "reflect"
)
type WireFormat int32
@@ -123,7 +122,7 @@
return xxx_File_conformance_conformance_proto_messageTypes[0].MessageOf(m)
}
func (m *FailureSet) Reset() { *m = FailureSet{} }
-func (m *FailureSet) String() string { return proto.CompactTextString(m) }
+func (m *FailureSet) String() string { return protoimpl.X.MessageStringOf(m) }
func (*FailureSet) ProtoMessage() {}
// Deprecated: Use FailureSet.ProtoReflect.Type instead.
@@ -131,24 +130,6 @@
return xxx_File_conformance_conformance_proto_rawdesc_gzipped, []int{0}
}
-func (m *FailureSet) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FailureSet.Unmarshal(m, b)
-}
-func (m *FailureSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FailureSet.Marshal(b, m, deterministic)
-}
-func (m *FailureSet) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FailureSet.Merge(m, src)
-}
-func (m *FailureSet) XXX_Size() int {
- return xxx_messageInfo_FailureSet.Size(m)
-}
-func (m *FailureSet) XXX_DiscardUnknown() {
- xxx_messageInfo_FailureSet.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FailureSet proto.InternalMessageInfo
-
func (m *FailureSet) GetFailure() []string {
if m != nil {
return m.Failure
@@ -198,7 +179,7 @@
return xxx_File_conformance_conformance_proto_messageTypes[1].MessageOf(m)
}
func (m *ConformanceRequest) Reset() { *m = ConformanceRequest{} }
-func (m *ConformanceRequest) String() string { return proto.CompactTextString(m) }
+func (m *ConformanceRequest) String() string { return protoimpl.X.MessageStringOf(m) }
func (*ConformanceRequest) ProtoMessage() {}
// Deprecated: Use ConformanceRequest.ProtoReflect.Type instead.
@@ -206,24 +187,6 @@
return xxx_File_conformance_conformance_proto_rawdesc_gzipped, []int{1}
}
-func (m *ConformanceRequest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ConformanceRequest.Unmarshal(m, b)
-}
-func (m *ConformanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ConformanceRequest.Marshal(b, m, deterministic)
-}
-func (m *ConformanceRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ConformanceRequest.Merge(m, src)
-}
-func (m *ConformanceRequest) XXX_Size() int {
- return xxx_messageInfo_ConformanceRequest.Size(m)
-}
-func (m *ConformanceRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ConformanceRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ConformanceRequest proto.InternalMessageInfo
-
type isConformanceRequest_Payload interface {
isConformanceRequest_Payload()
}
@@ -368,7 +331,7 @@
return xxx_File_conformance_conformance_proto_messageTypes[2].MessageOf(m)
}
func (m *ConformanceResponse) Reset() { *m = ConformanceResponse{} }
-func (m *ConformanceResponse) String() string { return proto.CompactTextString(m) }
+func (m *ConformanceResponse) String() string { return protoimpl.X.MessageStringOf(m) }
func (*ConformanceResponse) ProtoMessage() {}
// Deprecated: Use ConformanceResponse.ProtoReflect.Type instead.
@@ -376,24 +339,6 @@
return xxx_File_conformance_conformance_proto_rawdesc_gzipped, []int{2}
}
-func (m *ConformanceResponse) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ConformanceResponse.Unmarshal(m, b)
-}
-func (m *ConformanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ConformanceResponse.Marshal(b, m, deterministic)
-}
-func (m *ConformanceResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ConformanceResponse.Merge(m, src)
-}
-func (m *ConformanceResponse) XXX_Size() int {
- return xxx_messageInfo_ConformanceResponse.Size(m)
-}
-func (m *ConformanceResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ConformanceResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ConformanceResponse proto.InternalMessageInfo
-
type isConformanceResponse_Result interface {
isConformanceResponse_Result()
}
@@ -536,7 +481,7 @@
return xxx_File_conformance_conformance_proto_messageTypes[3].MessageOf(m)
}
func (m *JspbEncodingConfig) Reset() { *m = JspbEncodingConfig{} }
-func (m *JspbEncodingConfig) String() string { return proto.CompactTextString(m) }
+func (m *JspbEncodingConfig) String() string { return protoimpl.X.MessageStringOf(m) }
func (*JspbEncodingConfig) ProtoMessage() {}
// Deprecated: Use JspbEncodingConfig.ProtoReflect.Type instead.
@@ -544,24 +489,6 @@
return xxx_File_conformance_conformance_proto_rawdesc_gzipped, []int{3}
}
-func (m *JspbEncodingConfig) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_JspbEncodingConfig.Unmarshal(m, b)
-}
-func (m *JspbEncodingConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_JspbEncodingConfig.Marshal(b, m, deterministic)
-}
-func (m *JspbEncodingConfig) XXX_Merge(src proto.Message) {
- xxx_messageInfo_JspbEncodingConfig.Merge(m, src)
-}
-func (m *JspbEncodingConfig) XXX_Size() int {
- return xxx_messageInfo_JspbEncodingConfig.Size(m)
-}
-func (m *JspbEncodingConfig) XXX_DiscardUnknown() {
- xxx_messageInfo_JspbEncodingConfig.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_JspbEncodingConfig proto.InternalMessageInfo
-
func (m *JspbEncodingConfig) GetUseJspbArrayAnyFormat() bool {
if m != nil {
return m.UseJspbArrayAnyFormat
@@ -682,26 +609,15 @@
if File_conformance_conformance_proto != nil {
return
}
- messageTypes := make([]protoreflect.MessageType, 4)
File_conformance_conformance_proto = protoimpl.FileBuilder{
RawDescriptor: xxx_File_conformance_conformance_proto_rawdesc,
GoTypes: xxx_File_conformance_conformance_proto_goTypes,
DependencyIndexes: xxx_File_conformance_conformance_proto_depIdxs,
EnumOutputTypes: xxx_File_conformance_conformance_proto_enumTypes,
- MessageOutputTypes: messageTypes,
+ MessageOutputTypes: xxx_File_conformance_conformance_proto_messageTypes,
+ FilesRegistry: protoregistry.GlobalFiles,
+ TypesRegistry: protoregistry.GlobalTypes,
}.Init()
- messageGoTypes := xxx_File_conformance_conformance_proto_goTypes[2:][:4]
- for i, mt := range messageTypes {
- xxx_File_conformance_conformance_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
- xxx_File_conformance_conformance_proto_messageTypes[i].PBType = mt
- }
- proto.RegisterFile("conformance/conformance.proto", xxx_File_conformance_conformance_proto_rawdesc_gzipped)
- proto.RegisterEnum("conformance.WireFormat", WireFormat_name, WireFormat_value)
- proto.RegisterEnum("conformance.TestCategory", TestCategory_name, TestCategory_value)
- proto.RegisterType((*FailureSet)(nil), "conformance.FailureSet")
- proto.RegisterType((*ConformanceRequest)(nil), "conformance.ConformanceRequest")
- proto.RegisterType((*ConformanceResponse)(nil), "conformance.ConformanceResponse")
- proto.RegisterType((*JspbEncodingConfig)(nil), "conformance.JspbEncodingConfig")
xxx_File_conformance_conformance_proto_goTypes = nil
xxx_File_conformance_conformance_proto_depIdxs = nil
}
diff --git a/internal/testprotos/legacy/legacy.pb.go b/internal/testprotos/legacy/legacy.pb.go
index 5940e58..ff9da05 100644
--- a/internal/testprotos/legacy/legacy.pb.go
+++ b/internal/testprotos/legacy/legacy.pb.go
@@ -4,7 +4,6 @@
package legacy
import (
- proto "github.com/golang/protobuf/proto"
proto2_v0_0 "github.com/golang/protobuf/v2/internal/testprotos/legacy/proto2.v0.0.0-20160225-2fc053c5"
proto2_v0_01 "github.com/golang/protobuf/v2/internal/testprotos/legacy/proto2.v0.0.0-20160519-a4ab9ec5"
proto2_v1_0 "github.com/golang/protobuf/v2/internal/testprotos/legacy/proto2.v1.0.0-20180125-92554152"
@@ -18,8 +17,8 @@
proto3_v1_2 "github.com/golang/protobuf/v2/internal/testprotos/legacy/proto3.v1.2.0-20180814-aa810b61"
proto3_v1_21 "github.com/golang/protobuf/v2/internal/testprotos/legacy/proto3.v1.2.1-20181126-8d0c54c1"
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
+ protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
- reflect "reflect"
)
type Legacy struct {
@@ -44,7 +43,7 @@
return xxx_File_legacy_legacy_proto_messageTypes[0].MessageOf(m)
}
func (m *Legacy) Reset() { *m = Legacy{} }
-func (m *Legacy) String() string { return proto.CompactTextString(m) }
+func (m *Legacy) String() string { return protoimpl.X.MessageStringOf(m) }
func (*Legacy) ProtoMessage() {}
// Deprecated: Use Legacy.ProtoReflect.Type instead.
@@ -52,24 +51,6 @@
return xxx_File_legacy_legacy_proto_rawdesc_gzipped, []int{0}
}
-func (m *Legacy) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Legacy.Unmarshal(m, b)
-}
-func (m *Legacy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Legacy.Marshal(b, m, deterministic)
-}
-func (m *Legacy) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Legacy.Merge(m, src)
-}
-func (m *Legacy) XXX_Size() int {
- return xxx_messageInfo_Legacy.Size(m)
-}
-func (m *Legacy) XXX_DiscardUnknown() {
- xxx_messageInfo_Legacy.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Legacy proto.InternalMessageInfo
-
func (m *Legacy) GetF1() *proto2_v0_0.Message {
if m != nil {
return m.F1
@@ -292,20 +273,14 @@
if File_legacy_legacy_proto != nil {
return
}
- messageTypes := make([]protoreflect.MessageType, 1)
File_legacy_legacy_proto = protoimpl.FileBuilder{
RawDescriptor: xxx_File_legacy_legacy_proto_rawdesc,
GoTypes: xxx_File_legacy_legacy_proto_goTypes,
DependencyIndexes: xxx_File_legacy_legacy_proto_depIdxs,
- MessageOutputTypes: messageTypes,
+ MessageOutputTypes: xxx_File_legacy_legacy_proto_messageTypes,
+ FilesRegistry: protoregistry.GlobalFiles,
+ TypesRegistry: protoregistry.GlobalTypes,
}.Init()
- messageGoTypes := xxx_File_legacy_legacy_proto_goTypes[0:][:1]
- for i, mt := range messageTypes {
- xxx_File_legacy_legacy_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
- xxx_File_legacy_legacy_proto_messageTypes[i].PBType = mt
- }
- proto.RegisterFile("legacy/legacy.proto", xxx_File_legacy_legacy_proto_rawdesc_gzipped)
- proto.RegisterType((*Legacy)(nil), "google.golang.org.Legacy")
xxx_File_legacy_legacy_proto_goTypes = nil
xxx_File_legacy_legacy_proto_depIdxs = nil
}
diff --git a/internal/testprotos/test/ext.pb.go b/internal/testprotos/test/ext.pb.go
index 065a38e..aa1fa3b 100644
--- a/internal/testprotos/test/ext.pb.go
+++ b/internal/testprotos/test/ext.pb.go
@@ -4,8 +4,8 @@
package test
import (
- proto "github.com/golang/protobuf/proto"
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"
)
@@ -67,9 +67,9 @@
DependencyIndexes: xxx_File_test_ext_proto_depIdxs,
LegacyExtensions: xxx_File_test_ext_proto_extDescs,
ExtensionOutputTypes: extensionTypes,
+ FilesRegistry: protoregistry.GlobalFiles,
+ TypesRegistry: protoregistry.GlobalTypes,
}.Init()
- proto.RegisterFile("test/ext.proto", xxx_File_test_ext_proto_rawdesc_gzipped)
- proto.RegisterExtension(E_ForeignInt32Extension)
xxx_File_test_ext_proto_goTypes = nil
xxx_File_test_ext_proto_depIdxs = nil
}
diff --git a/internal/testprotos/test/test.pb.go b/internal/testprotos/test/test.pb.go
index 24ef243..7d3790a 100644
--- a/internal/testprotos/test/test.pb.go
+++ b/internal/testprotos/test/test.pb.go
@@ -4,11 +4,10 @@
package test
import (
- proto "github.com/golang/protobuf/proto"
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"
- reflect "reflect"
)
type ForeignEnum int32
@@ -309,7 +308,7 @@
return xxx_File_test_test_proto_messageTypes[0].MessageOf(m)
}
func (m *TestAllTypes) Reset() { *m = TestAllTypes{} }
-func (m *TestAllTypes) String() string { return proto.CompactTextString(m) }
+func (m *TestAllTypes) String() string { return protoimpl.X.MessageStringOf(m) }
func (*TestAllTypes) ProtoMessage() {}
// Deprecated: Use TestAllTypes.ProtoReflect.Type instead.
@@ -317,24 +316,6 @@
return xxx_File_test_test_proto_rawdesc_gzipped, []int{0}
}
-func (m *TestAllTypes) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_TestAllTypes.Unmarshal(m, b)
-}
-func (m *TestAllTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_TestAllTypes.Marshal(b, m, deterministic)
-}
-func (m *TestAllTypes) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TestAllTypes.Merge(m, src)
-}
-func (m *TestAllTypes) XXX_Size() int {
- return xxx_messageInfo_TestAllTypes.Size(m)
-}
-func (m *TestAllTypes) XXX_DiscardUnknown() {
- xxx_messageInfo_TestAllTypes.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TestAllTypes proto.InternalMessageInfo
-
const Default_TestAllTypes_DefaultInt32 int32 = 81
const Default_TestAllTypes_DefaultInt64 int64 = 82
const Default_TestAllTypes_DefaultUint32 uint32 = 83
@@ -1059,7 +1040,7 @@
return xxx_File_test_test_proto_messageTypes[1].MessageOf(m)
}
func (m *TestDeprecatedMessage) Reset() { *m = TestDeprecatedMessage{} }
-func (m *TestDeprecatedMessage) String() string { return proto.CompactTextString(m) }
+func (m *TestDeprecatedMessage) String() string { return protoimpl.X.MessageStringOf(m) }
func (*TestDeprecatedMessage) ProtoMessage() {}
// Deprecated: Use TestDeprecatedMessage.ProtoReflect.Type instead.
@@ -1067,24 +1048,6 @@
return xxx_File_test_test_proto_rawdesc_gzipped, []int{1}
}
-func (m *TestDeprecatedMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_TestDeprecatedMessage.Unmarshal(m, b)
-}
-func (m *TestDeprecatedMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_TestDeprecatedMessage.Marshal(b, m, deterministic)
-}
-func (m *TestDeprecatedMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TestDeprecatedMessage.Merge(m, src)
-}
-func (m *TestDeprecatedMessage) XXX_Size() int {
- return xxx_messageInfo_TestDeprecatedMessage.Size(m)
-}
-func (m *TestDeprecatedMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_TestDeprecatedMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TestDeprecatedMessage proto.InternalMessageInfo
-
// Deprecated: Do not use.
func (m *TestDeprecatedMessage) GetDeprecatedInt32() int32 {
if m != nil && m.DeprecatedInt32 != nil {
@@ -1137,7 +1100,7 @@
return xxx_File_test_test_proto_messageTypes[2].MessageOf(m)
}
func (m *ForeignMessage) Reset() { *m = ForeignMessage{} }
-func (m *ForeignMessage) String() string { return proto.CompactTextString(m) }
+func (m *ForeignMessage) String() string { return protoimpl.X.MessageStringOf(m) }
func (*ForeignMessage) ProtoMessage() {}
// Deprecated: Use ForeignMessage.ProtoReflect.Type instead.
@@ -1145,24 +1108,6 @@
return xxx_File_test_test_proto_rawdesc_gzipped, []int{2}
}
-func (m *ForeignMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ForeignMessage.Unmarshal(m, b)
-}
-func (m *ForeignMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ForeignMessage.Marshal(b, m, deterministic)
-}
-func (m *ForeignMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ForeignMessage.Merge(m, src)
-}
-func (m *ForeignMessage) XXX_Size() int {
- return xxx_messageInfo_ForeignMessage.Size(m)
-}
-func (m *ForeignMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_ForeignMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ForeignMessage proto.InternalMessageInfo
-
func (m *ForeignMessage) GetC() int32 {
if m != nil && m.C != nil {
return *m.C
@@ -1187,7 +1132,7 @@
return xxx_File_test_test_proto_messageTypes[3].MessageOf(m)
}
func (m *TestReservedFields) Reset() { *m = TestReservedFields{} }
-func (m *TestReservedFields) String() string { return proto.CompactTextString(m) }
+func (m *TestReservedFields) String() string { return protoimpl.X.MessageStringOf(m) }
func (*TestReservedFields) ProtoMessage() {}
// Deprecated: Use TestReservedFields.ProtoReflect.Type instead.
@@ -1195,24 +1140,6 @@
return xxx_File_test_test_proto_rawdesc_gzipped, []int{3}
}
-func (m *TestReservedFields) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_TestReservedFields.Unmarshal(m, b)
-}
-func (m *TestReservedFields) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_TestReservedFields.Marshal(b, m, deterministic)
-}
-func (m *TestReservedFields) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TestReservedFields.Merge(m, src)
-}
-func (m *TestReservedFields) XXX_Size() int {
- return xxx_messageInfo_TestReservedFields.Size(m)
-}
-func (m *TestReservedFields) XXX_DiscardUnknown() {
- xxx_messageInfo_TestReservedFields.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TestReservedFields proto.InternalMessageInfo
-
type TestAllExtensions struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_InternalExtensions protoimpl.ExtensionFieldsV1 `json:"-"`
@@ -1224,7 +1151,7 @@
return xxx_File_test_test_proto_messageTypes[4].MessageOf(m)
}
func (m *TestAllExtensions) Reset() { *m = TestAllExtensions{} }
-func (m *TestAllExtensions) String() string { return proto.CompactTextString(m) }
+func (m *TestAllExtensions) String() string { return protoimpl.X.MessageStringOf(m) }
func (*TestAllExtensions) ProtoMessage() {}
// Deprecated: Use TestAllExtensions.ProtoReflect.Type instead.
@@ -1241,24 +1168,6 @@
return extRange_TestAllExtensions
}
-func (m *TestAllExtensions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_TestAllExtensions.Unmarshal(m, b)
-}
-func (m *TestAllExtensions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_TestAllExtensions.Marshal(b, m, deterministic)
-}
-func (m *TestAllExtensions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TestAllExtensions.Merge(m, src)
-}
-func (m *TestAllExtensions) XXX_Size() int {
- return xxx_messageInfo_TestAllExtensions.Size(m)
-}
-func (m *TestAllExtensions) XXX_DiscardUnknown() {
- xxx_messageInfo_TestAllExtensions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TestAllExtensions proto.InternalMessageInfo
-
type OptionalGroupExtension struct {
A *int32 `protobuf:"varint,17,opt,name=a" json:"a,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@@ -1270,7 +1179,7 @@
return xxx_File_test_test_proto_messageTypes[5].MessageOf(m)
}
func (m *OptionalGroupExtension) Reset() { *m = OptionalGroupExtension{} }
-func (m *OptionalGroupExtension) String() string { return proto.CompactTextString(m) }
+func (m *OptionalGroupExtension) String() string { return protoimpl.X.MessageStringOf(m) }
func (*OptionalGroupExtension) ProtoMessage() {}
// Deprecated: Use OptionalGroupExtension.ProtoReflect.Type instead.
@@ -1278,24 +1187,6 @@
return xxx_File_test_test_proto_rawdesc_gzipped, []int{5}
}
-func (m *OptionalGroupExtension) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_OptionalGroupExtension.Unmarshal(m, b)
-}
-func (m *OptionalGroupExtension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_OptionalGroupExtension.Marshal(b, m, deterministic)
-}
-func (m *OptionalGroupExtension) XXX_Merge(src proto.Message) {
- xxx_messageInfo_OptionalGroupExtension.Merge(m, src)
-}
-func (m *OptionalGroupExtension) XXX_Size() int {
- return xxx_messageInfo_OptionalGroupExtension.Size(m)
-}
-func (m *OptionalGroupExtension) XXX_DiscardUnknown() {
- xxx_messageInfo_OptionalGroupExtension.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_OptionalGroupExtension proto.InternalMessageInfo
-
func (m *OptionalGroupExtension) GetA() int32 {
if m != nil && m.A != nil {
return *m.A
@@ -1314,7 +1205,7 @@
return xxx_File_test_test_proto_messageTypes[6].MessageOf(m)
}
func (m *RepeatedGroupExtension) Reset() { *m = RepeatedGroupExtension{} }
-func (m *RepeatedGroupExtension) String() string { return proto.CompactTextString(m) }
+func (m *RepeatedGroupExtension) String() string { return protoimpl.X.MessageStringOf(m) }
func (*RepeatedGroupExtension) ProtoMessage() {}
// Deprecated: Use RepeatedGroupExtension.ProtoReflect.Type instead.
@@ -1322,24 +1213,6 @@
return xxx_File_test_test_proto_rawdesc_gzipped, []int{6}
}
-func (m *RepeatedGroupExtension) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_RepeatedGroupExtension.Unmarshal(m, b)
-}
-func (m *RepeatedGroupExtension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_RepeatedGroupExtension.Marshal(b, m, deterministic)
-}
-func (m *RepeatedGroupExtension) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RepeatedGroupExtension.Merge(m, src)
-}
-func (m *RepeatedGroupExtension) XXX_Size() int {
- return xxx_messageInfo_RepeatedGroupExtension.Size(m)
-}
-func (m *RepeatedGroupExtension) XXX_DiscardUnknown() {
- xxx_messageInfo_RepeatedGroupExtension.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_RepeatedGroupExtension proto.InternalMessageInfo
-
func (m *RepeatedGroupExtension) GetA() int32 {
if m != nil && m.A != nil {
return *m.A
@@ -1357,7 +1230,7 @@
return xxx_File_test_test_proto_messageTypes[7].MessageOf(m)
}
func (m *TestNestedExtension) Reset() { *m = TestNestedExtension{} }
-func (m *TestNestedExtension) String() string { return proto.CompactTextString(m) }
+func (m *TestNestedExtension) String() string { return protoimpl.X.MessageStringOf(m) }
func (*TestNestedExtension) ProtoMessage() {}
// Deprecated: Use TestNestedExtension.ProtoReflect.Type instead.
@@ -1365,24 +1238,6 @@
return xxx_File_test_test_proto_rawdesc_gzipped, []int{7}
}
-func (m *TestNestedExtension) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_TestNestedExtension.Unmarshal(m, b)
-}
-func (m *TestNestedExtension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_TestNestedExtension.Marshal(b, m, deterministic)
-}
-func (m *TestNestedExtension) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TestNestedExtension.Merge(m, src)
-}
-func (m *TestNestedExtension) XXX_Size() int {
- return xxx_messageInfo_TestNestedExtension.Size(m)
-}
-func (m *TestNestedExtension) XXX_DiscardUnknown() {
- xxx_messageInfo_TestNestedExtension.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TestNestedExtension proto.InternalMessageInfo
-
// Test that RPC services work.
type FooRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@@ -1394,7 +1249,7 @@
return xxx_File_test_test_proto_messageTypes[8].MessageOf(m)
}
func (m *FooRequest) Reset() { *m = FooRequest{} }
-func (m *FooRequest) String() string { return proto.CompactTextString(m) }
+func (m *FooRequest) String() string { return protoimpl.X.MessageStringOf(m) }
func (*FooRequest) ProtoMessage() {}
// Deprecated: Use FooRequest.ProtoReflect.Type instead.
@@ -1402,24 +1257,6 @@
return xxx_File_test_test_proto_rawdesc_gzipped, []int{8}
}
-func (m *FooRequest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FooRequest.Unmarshal(m, b)
-}
-func (m *FooRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FooRequest.Marshal(b, m, deterministic)
-}
-func (m *FooRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FooRequest.Merge(m, src)
-}
-func (m *FooRequest) XXX_Size() int {
- return xxx_messageInfo_FooRequest.Size(m)
-}
-func (m *FooRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_FooRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FooRequest proto.InternalMessageInfo
-
type FooResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
@@ -1430,7 +1267,7 @@
return xxx_File_test_test_proto_messageTypes[9].MessageOf(m)
}
func (m *FooResponse) Reset() { *m = FooResponse{} }
-func (m *FooResponse) String() string { return proto.CompactTextString(m) }
+func (m *FooResponse) String() string { return protoimpl.X.MessageStringOf(m) }
func (*FooResponse) ProtoMessage() {}
// Deprecated: Use FooResponse.ProtoReflect.Type instead.
@@ -1438,24 +1275,6 @@
return xxx_File_test_test_proto_rawdesc_gzipped, []int{9}
}
-func (m *FooResponse) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FooResponse.Unmarshal(m, b)
-}
-func (m *FooResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FooResponse.Marshal(b, m, deterministic)
-}
-func (m *FooResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FooResponse.Merge(m, src)
-}
-func (m *FooResponse) XXX_Size() int {
- return xxx_messageInfo_FooResponse.Size(m)
-}
-func (m *FooResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_FooResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FooResponse proto.InternalMessageInfo
-
type TestAllTypes_NestedMessage struct {
A *int32 `protobuf:"varint,1,opt,name=a" json:"a,omitempty"`
Corecursive *TestAllTypes `protobuf:"bytes,2,opt,name=corecursive" json:"corecursive,omitempty"`
@@ -1468,7 +1287,7 @@
return xxx_File_test_test_proto_messageTypes[10].MessageOf(m)
}
func (m *TestAllTypes_NestedMessage) Reset() { *m = TestAllTypes_NestedMessage{} }
-func (m *TestAllTypes_NestedMessage) String() string { return proto.CompactTextString(m) }
+func (m *TestAllTypes_NestedMessage) String() string { return protoimpl.X.MessageStringOf(m) }
func (*TestAllTypes_NestedMessage) ProtoMessage() {}
// Deprecated: Use TestAllTypes_NestedMessage.ProtoReflect.Type instead.
@@ -1476,24 +1295,6 @@
return xxx_File_test_test_proto_rawdesc_gzipped, []int{0, 0}
}
-func (m *TestAllTypes_NestedMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_TestAllTypes_NestedMessage.Unmarshal(m, b)
-}
-func (m *TestAllTypes_NestedMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_TestAllTypes_NestedMessage.Marshal(b, m, deterministic)
-}
-func (m *TestAllTypes_NestedMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TestAllTypes_NestedMessage.Merge(m, src)
-}
-func (m *TestAllTypes_NestedMessage) XXX_Size() int {
- return xxx_messageInfo_TestAllTypes_NestedMessage.Size(m)
-}
-func (m *TestAllTypes_NestedMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_TestAllTypes_NestedMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TestAllTypes_NestedMessage proto.InternalMessageInfo
-
func (m *TestAllTypes_NestedMessage) GetA() int32 {
if m != nil && m.A != nil {
return *m.A
@@ -1519,7 +1320,7 @@
return xxx_File_test_test_proto_messageTypes[11].MessageOf(m)
}
func (m *TestAllTypes_OptionalGroup) Reset() { *m = TestAllTypes_OptionalGroup{} }
-func (m *TestAllTypes_OptionalGroup) String() string { return proto.CompactTextString(m) }
+func (m *TestAllTypes_OptionalGroup) String() string { return protoimpl.X.MessageStringOf(m) }
func (*TestAllTypes_OptionalGroup) ProtoMessage() {}
// Deprecated: Use TestAllTypes_OptionalGroup.ProtoReflect.Type instead.
@@ -1527,24 +1328,6 @@
return xxx_File_test_test_proto_rawdesc_gzipped, []int{0, 1}
}
-func (m *TestAllTypes_OptionalGroup) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_TestAllTypes_OptionalGroup.Unmarshal(m, b)
-}
-func (m *TestAllTypes_OptionalGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_TestAllTypes_OptionalGroup.Marshal(b, m, deterministic)
-}
-func (m *TestAllTypes_OptionalGroup) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TestAllTypes_OptionalGroup.Merge(m, src)
-}
-func (m *TestAllTypes_OptionalGroup) XXX_Size() int {
- return xxx_messageInfo_TestAllTypes_OptionalGroup.Size(m)
-}
-func (m *TestAllTypes_OptionalGroup) XXX_DiscardUnknown() {
- xxx_messageInfo_TestAllTypes_OptionalGroup.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TestAllTypes_OptionalGroup proto.InternalMessageInfo
-
func (m *TestAllTypes_OptionalGroup) GetA() int32 {
if m != nil && m.A != nil {
return *m.A
@@ -1563,7 +1346,7 @@
return xxx_File_test_test_proto_messageTypes[12].MessageOf(m)
}
func (m *TestAllTypes_RepeatedGroup) Reset() { *m = TestAllTypes_RepeatedGroup{} }
-func (m *TestAllTypes_RepeatedGroup) String() string { return proto.CompactTextString(m) }
+func (m *TestAllTypes_RepeatedGroup) String() string { return protoimpl.X.MessageStringOf(m) }
func (*TestAllTypes_RepeatedGroup) ProtoMessage() {}
// Deprecated: Use TestAllTypes_RepeatedGroup.ProtoReflect.Type instead.
@@ -1571,24 +1354,6 @@
return xxx_File_test_test_proto_rawdesc_gzipped, []int{0, 2}
}
-func (m *TestAllTypes_RepeatedGroup) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_TestAllTypes_RepeatedGroup.Unmarshal(m, b)
-}
-func (m *TestAllTypes_RepeatedGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_TestAllTypes_RepeatedGroup.Marshal(b, m, deterministic)
-}
-func (m *TestAllTypes_RepeatedGroup) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TestAllTypes_RepeatedGroup.Merge(m, src)
-}
-func (m *TestAllTypes_RepeatedGroup) XXX_Size() int {
- return xxx_messageInfo_TestAllTypes_RepeatedGroup.Size(m)
-}
-func (m *TestAllTypes_RepeatedGroup) XXX_DiscardUnknown() {
- xxx_messageInfo_TestAllTypes_RepeatedGroup.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TestAllTypes_RepeatedGroup proto.InternalMessageInfo
-
func (m *TestAllTypes_RepeatedGroup) GetA() int32 {
if m != nil && m.A != nil {
return *m.A
@@ -2909,7 +2674,6 @@
xxx_File_test_test_import_proto_init()
xxx_File_test_test_public_proto_init()
xxx_File_test_test_weak_proto_init()
- messageTypes := make([]protoreflect.MessageType, 30)
extensionTypes := make([]protoreflect.ExtensionType, 37)
File_test_test_proto = protoimpl.FileBuilder{
RawDescriptor: xxx_File_test_test_proto_rawdesc,
@@ -2917,86 +2681,11 @@
DependencyIndexes: xxx_File_test_test_proto_depIdxs,
LegacyExtensions: xxx_File_test_test_proto_extDescs,
EnumOutputTypes: xxx_File_test_test_proto_enumTypes,
- MessageOutputTypes: messageTypes,
+ MessageOutputTypes: xxx_File_test_test_proto_messageTypes,
ExtensionOutputTypes: extensionTypes,
+ FilesRegistry: protoregistry.GlobalFiles,
+ TypesRegistry: protoregistry.GlobalTypes,
}.Init()
- messageGoTypes := xxx_File_test_test_proto_goTypes[4:][:30]
- for i, mt := range messageTypes {
- xxx_File_test_test_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
- xxx_File_test_test_proto_messageTypes[i].PBType = mt
- }
- proto.RegisterFile("test/test.proto", xxx_File_test_test_proto_rawdesc_gzipped)
- proto.RegisterEnum("goproto.proto.test.ForeignEnum", ForeignEnum_name, ForeignEnum_value)
- proto.RegisterEnum("goproto.proto.test.TestReservedEnumFields", TestReservedEnumFields_name, TestReservedEnumFields_value)
- proto.RegisterEnum("goproto.proto.test.TestAllTypes_NestedEnum", TestAllTypes_NestedEnum_name, TestAllTypes_NestedEnum_value)
- proto.RegisterEnum("goproto.proto.test.TestDeprecatedMessage_DeprecatedEnum", TestDeprecatedMessage_DeprecatedEnum_name, TestDeprecatedMessage_DeprecatedEnum_value)
- proto.RegisterType((*TestAllTypes)(nil), "goproto.proto.test.TestAllTypes")
- proto.RegisterMapType((map[bool]bool)(nil), "goproto.proto.test.TestAllTypes.MapBoolBoolEntry")
- proto.RegisterMapType((map[uint32]uint32)(nil), "goproto.proto.test.TestAllTypes.MapFixed32Fixed32Entry")
- proto.RegisterMapType((map[uint64]uint64)(nil), "goproto.proto.test.TestAllTypes.MapFixed64Fixed64Entry")
- proto.RegisterMapType((map[int32]float64)(nil), "goproto.proto.test.TestAllTypes.MapInt32DoubleEntry")
- proto.RegisterMapType((map[int32]float32)(nil), "goproto.proto.test.TestAllTypes.MapInt32FloatEntry")
- proto.RegisterMapType((map[int32]int32)(nil), "goproto.proto.test.TestAllTypes.MapInt32Int32Entry")
- proto.RegisterMapType((map[int64]int64)(nil), "goproto.proto.test.TestAllTypes.MapInt64Int64Entry")
- proto.RegisterMapType((map[int32]int32)(nil), "goproto.proto.test.TestAllTypes.MapSfixed32Sfixed32Entry")
- proto.RegisterMapType((map[int64]int64)(nil), "goproto.proto.test.TestAllTypes.MapSfixed64Sfixed64Entry")
- proto.RegisterMapType((map[int32]int32)(nil), "goproto.proto.test.TestAllTypes.MapSint32Sint32Entry")
- proto.RegisterMapType((map[int64]int64)(nil), "goproto.proto.test.TestAllTypes.MapSint64Sint64Entry")
- proto.RegisterMapType((map[string][]byte)(nil), "goproto.proto.test.TestAllTypes.MapStringBytesEntry")
- proto.RegisterMapType((map[string]TestAllTypes_NestedEnum)(nil), "goproto.proto.test.TestAllTypes.MapStringNestedEnumEntry")
- proto.RegisterMapType((map[string]*TestAllTypes_NestedMessage)(nil), "goproto.proto.test.TestAllTypes.MapStringNestedMessageEntry")
- proto.RegisterMapType((map[string]string)(nil), "goproto.proto.test.TestAllTypes.MapStringStringEntry")
- proto.RegisterMapType((map[uint32]uint32)(nil), "goproto.proto.test.TestAllTypes.MapUint32Uint32Entry")
- proto.RegisterMapType((map[uint64]uint64)(nil), "goproto.proto.test.TestAllTypes.MapUint64Uint64Entry")
- proto.RegisterType((*TestDeprecatedMessage)(nil), "goproto.proto.test.TestDeprecatedMessage")
- proto.RegisterType((*ForeignMessage)(nil), "goproto.proto.test.ForeignMessage")
- proto.RegisterType((*TestReservedFields)(nil), "goproto.proto.test.TestReservedFields")
- proto.RegisterType((*TestAllExtensions)(nil), "goproto.proto.test.TestAllExtensions")
- proto.RegisterType((*OptionalGroupExtension)(nil), "goproto.proto.test.OptionalGroup_extension")
- proto.RegisterType((*RepeatedGroupExtension)(nil), "goproto.proto.test.RepeatedGroup_extension")
- proto.RegisterType((*TestNestedExtension)(nil), "goproto.proto.test.TestNestedExtension")
- proto.RegisterType((*FooRequest)(nil), "goproto.proto.test.FooRequest")
- proto.RegisterType((*FooResponse)(nil), "goproto.proto.test.FooResponse")
- proto.RegisterType((*TestAllTypes_NestedMessage)(nil), "goproto.proto.test.TestAllTypes.NestedMessage")
- proto.RegisterType((*TestAllTypes_OptionalGroup)(nil), "goproto.proto.test.TestAllTypes.OptionalGroup")
- proto.RegisterType((*TestAllTypes_RepeatedGroup)(nil), "goproto.proto.test.TestAllTypes.RepeatedGroup")
- proto.RegisterExtension(E_OptionalInt32Extension)
- proto.RegisterExtension(E_OptionalInt64Extension)
- proto.RegisterExtension(E_OptionalUint32Extension)
- proto.RegisterExtension(E_OptionalUint64Extension)
- proto.RegisterExtension(E_OptionalSint32Extension)
- proto.RegisterExtension(E_OptionalSint64Extension)
- proto.RegisterExtension(E_OptionalFixed32Extension)
- proto.RegisterExtension(E_OptionalFixed64Extension)
- proto.RegisterExtension(E_OptionalSfixed32Extension)
- proto.RegisterExtension(E_OptionalSfixed64Extension)
- proto.RegisterExtension(E_OptionalFloatExtension)
- proto.RegisterExtension(E_OptionalDoubleExtension)
- proto.RegisterExtension(E_OptionalBoolExtension)
- proto.RegisterExtension(E_OptionalStringExtension)
- proto.RegisterExtension(E_OptionalBytesExtension)
- proto.RegisterExtension(E_OptionalgroupExtension)
- proto.RegisterExtension(E_OptionalNestedMessageExtension)
- proto.RegisterExtension(E_OptionalNestedEnumExtension)
- proto.RegisterExtension(E_RepeatedInt32Extension)
- proto.RegisterExtension(E_RepeatedInt64Extension)
- proto.RegisterExtension(E_RepeatedUint32Extension)
- proto.RegisterExtension(E_RepeatedUint64Extension)
- proto.RegisterExtension(E_RepeatedSint32Extension)
- proto.RegisterExtension(E_RepeatedSint64Extension)
- proto.RegisterExtension(E_RepeatedFixed32Extension)
- proto.RegisterExtension(E_RepeatedFixed64Extension)
- proto.RegisterExtension(E_RepeatedSfixed32Extension)
- proto.RegisterExtension(E_RepeatedSfixed64Extension)
- proto.RegisterExtension(E_RepeatedFloatExtension)
- proto.RegisterExtension(E_RepeatedDoubleExtension)
- proto.RegisterExtension(E_RepeatedBoolExtension)
- proto.RegisterExtension(E_RepeatedStringExtension)
- proto.RegisterExtension(E_RepeatedBytesExtension)
- proto.RegisterExtension(E_RepeatedgroupExtension)
- proto.RegisterExtension(E_RepeatedNestedMessageExtension)
- proto.RegisterExtension(E_RepeatedNestedEnumExtension)
- proto.RegisterExtension(E_TestNestedExtension_NestedStringExtension)
xxx_File_test_test_proto_goTypes = nil
xxx_File_test_test_proto_depIdxs = nil
}
diff --git a/internal/testprotos/test/test_import.pb.go b/internal/testprotos/test/test_import.pb.go
index 82cadcd..bcde0f1 100644
--- a/internal/testprotos/test/test_import.pb.go
+++ b/internal/testprotos/test/test_import.pb.go
@@ -4,10 +4,9 @@
package test
import (
- proto "github.com/golang/protobuf/proto"
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
+ protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
- reflect "reflect"
)
type ImportEnum int32
@@ -66,7 +65,7 @@
return xxx_File_test_test_import_proto_messageTypes[0].MessageOf(m)
}
func (m *ImportMessage) Reset() { *m = ImportMessage{} }
-func (m *ImportMessage) String() string { return proto.CompactTextString(m) }
+func (m *ImportMessage) String() string { return protoimpl.X.MessageStringOf(m) }
func (*ImportMessage) ProtoMessage() {}
// Deprecated: Use ImportMessage.ProtoReflect.Type instead.
@@ -74,24 +73,6 @@
return xxx_File_test_test_import_proto_rawdesc_gzipped, []int{0}
}
-func (m *ImportMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ImportMessage.Unmarshal(m, b)
-}
-func (m *ImportMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ImportMessage.Marshal(b, m, deterministic)
-}
-func (m *ImportMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ImportMessage.Merge(m, src)
-}
-func (m *ImportMessage) XXX_Size() int {
- return xxx_messageInfo_ImportMessage.Size(m)
-}
-func (m *ImportMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_ImportMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ImportMessage proto.InternalMessageInfo
-
var xxx_File_test_test_import_proto_rawdesc = []byte{
// 150 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x16, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f,
@@ -125,22 +106,15 @@
if File_test_test_import_proto != nil {
return
}
- messageTypes := make([]protoreflect.MessageType, 1)
File_test_test_import_proto = protoimpl.FileBuilder{
RawDescriptor: xxx_File_test_test_import_proto_rawdesc,
GoTypes: xxx_File_test_test_import_proto_goTypes,
DependencyIndexes: xxx_File_test_test_import_proto_depIdxs,
EnumOutputTypes: xxx_File_test_test_import_proto_enumTypes,
- MessageOutputTypes: messageTypes,
+ MessageOutputTypes: xxx_File_test_test_import_proto_messageTypes,
+ FilesRegistry: protoregistry.GlobalFiles,
+ TypesRegistry: protoregistry.GlobalTypes,
}.Init()
- messageGoTypes := xxx_File_test_test_import_proto_goTypes[1:][:1]
- for i, mt := range messageTypes {
- xxx_File_test_test_import_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
- xxx_File_test_test_import_proto_messageTypes[i].PBType = mt
- }
- proto.RegisterFile("test/test_import.proto", xxx_File_test_test_import_proto_rawdesc_gzipped)
- proto.RegisterEnum("goproto.proto.test.ImportEnum", ImportEnum_name, ImportEnum_value)
- proto.RegisterType((*ImportMessage)(nil), "goproto.proto.test.ImportMessage")
xxx_File_test_test_import_proto_goTypes = nil
xxx_File_test_test_import_proto_depIdxs = nil
}
diff --git a/internal/testprotos/test/test_public.pb.go b/internal/testprotos/test/test_public.pb.go
index 6e5494a..db795c5 100644
--- a/internal/testprotos/test/test_public.pb.go
+++ b/internal/testprotos/test/test_public.pb.go
@@ -4,10 +4,9 @@
package test
import (
- proto "github.com/golang/protobuf/proto"
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
+ protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
- reflect "reflect"
)
type PublicImportMessage struct {
@@ -20,7 +19,7 @@
return xxx_File_test_test_public_proto_messageTypes[0].MessageOf(m)
}
func (m *PublicImportMessage) Reset() { *m = PublicImportMessage{} }
-func (m *PublicImportMessage) String() string { return proto.CompactTextString(m) }
+func (m *PublicImportMessage) String() string { return protoimpl.X.MessageStringOf(m) }
func (*PublicImportMessage) ProtoMessage() {}
// Deprecated: Use PublicImportMessage.ProtoReflect.Type instead.
@@ -28,24 +27,6 @@
return xxx_File_test_test_public_proto_rawdesc_gzipped, []int{0}
}
-func (m *PublicImportMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_PublicImportMessage.Unmarshal(m, b)
-}
-func (m *PublicImportMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_PublicImportMessage.Marshal(b, m, deterministic)
-}
-func (m *PublicImportMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PublicImportMessage.Merge(m, src)
-}
-func (m *PublicImportMessage) XXX_Size() int {
- return xxx_messageInfo_PublicImportMessage.Size(m)
-}
-func (m *PublicImportMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_PublicImportMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PublicImportMessage proto.InternalMessageInfo
-
var xxx_File_test_test_public_proto_rawdesc = []byte{
// 125 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x16, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c,
@@ -75,20 +56,14 @@
if File_test_test_public_proto != nil {
return
}
- messageTypes := make([]protoreflect.MessageType, 1)
File_test_test_public_proto = protoimpl.FileBuilder{
RawDescriptor: xxx_File_test_test_public_proto_rawdesc,
GoTypes: xxx_File_test_test_public_proto_goTypes,
DependencyIndexes: xxx_File_test_test_public_proto_depIdxs,
- MessageOutputTypes: messageTypes,
+ MessageOutputTypes: xxx_File_test_test_public_proto_messageTypes,
+ FilesRegistry: protoregistry.GlobalFiles,
+ TypesRegistry: protoregistry.GlobalTypes,
}.Init()
- messageGoTypes := xxx_File_test_test_public_proto_goTypes[0:][:1]
- for i, mt := range messageTypes {
- xxx_File_test_test_public_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
- xxx_File_test_test_public_proto_messageTypes[i].PBType = mt
- }
- proto.RegisterFile("test/test_public.proto", xxx_File_test_test_public_proto_rawdesc_gzipped)
- proto.RegisterType((*PublicImportMessage)(nil), "goproto.proto.test.PublicImportMessage")
xxx_File_test_test_public_proto_goTypes = nil
xxx_File_test_test_public_proto_depIdxs = nil
}
diff --git a/internal/testprotos/test/test_weak.pb.go b/internal/testprotos/test/test_weak.pb.go
index ce220c2..7562089 100644
--- a/internal/testprotos/test/test_weak.pb.go
+++ b/internal/testprotos/test/test_weak.pb.go
@@ -4,10 +4,9 @@
package test
import (
- proto "github.com/golang/protobuf/proto"
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
+ protoregistry "github.com/golang/protobuf/v2/reflect/protoregistry"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
- reflect "reflect"
)
type WeakImportMessage struct {
@@ -20,7 +19,7 @@
return xxx_File_test_test_weak_proto_messageTypes[0].MessageOf(m)
}
func (m *WeakImportMessage) Reset() { *m = WeakImportMessage{} }
-func (m *WeakImportMessage) String() string { return proto.CompactTextString(m) }
+func (m *WeakImportMessage) String() string { return protoimpl.X.MessageStringOf(m) }
func (*WeakImportMessage) ProtoMessage() {}
// Deprecated: Use WeakImportMessage.ProtoReflect.Type instead.
@@ -28,24 +27,6 @@
return xxx_File_test_test_weak_proto_rawdesc_gzipped, []int{0}
}
-func (m *WeakImportMessage) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_WeakImportMessage.Unmarshal(m, b)
-}
-func (m *WeakImportMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_WeakImportMessage.Marshal(b, m, deterministic)
-}
-func (m *WeakImportMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_WeakImportMessage.Merge(m, src)
-}
-func (m *WeakImportMessage) XXX_Size() int {
- return xxx_messageInfo_WeakImportMessage.Size(m)
-}
-func (m *WeakImportMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_WeakImportMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_WeakImportMessage proto.InternalMessageInfo
-
var xxx_File_test_test_weak_proto_rawdesc = []byte{
// 121 bytes of the wire-encoded FileDescriptorProto
0x0a, 0x14, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x77, 0x65, 0x61, 0x6b,
@@ -75,20 +56,14 @@
if File_test_test_weak_proto != nil {
return
}
- messageTypes := make([]protoreflect.MessageType, 1)
File_test_test_weak_proto = protoimpl.FileBuilder{
RawDescriptor: xxx_File_test_test_weak_proto_rawdesc,
GoTypes: xxx_File_test_test_weak_proto_goTypes,
DependencyIndexes: xxx_File_test_test_weak_proto_depIdxs,
- MessageOutputTypes: messageTypes,
+ MessageOutputTypes: xxx_File_test_test_weak_proto_messageTypes,
+ FilesRegistry: protoregistry.GlobalFiles,
+ TypesRegistry: protoregistry.GlobalTypes,
}.Init()
- messageGoTypes := xxx_File_test_test_weak_proto_goTypes[0:][:1]
- for i, mt := range messageTypes {
- xxx_File_test_test_weak_proto_messageTypes[i].GoType = reflect.TypeOf(messageGoTypes[i])
- xxx_File_test_test_weak_proto_messageTypes[i].PBType = mt
- }
- proto.RegisterFile("test/test_weak.proto", xxx_File_test_test_weak_proto_rawdesc_gzipped)
- proto.RegisterType((*WeakImportMessage)(nil), "goproto.proto.test.WeakImportMessage")
xxx_File_test_test_weak_proto_goTypes = nil
xxx_File_test_test_weak_proto_depIdxs = nil
}