From 0946f97cdf191385bad16a8e1ab080bb5612c4a5 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 19 Aug 2024 16:33:21 +0200 Subject: [PATCH] all: remove unused purego support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes golang/protobuf#1640 Change-Id: I0e8f2df27c6b86a6f7325524d788c852a9266f1f Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/606755 LUCI-TryBot-Result: Go LUCI Reviewed-by: Lasse Folger Reviewed-by: Christian Höppner --- cmd/protoc-gen-go/internal_gengo/reflect.go | 21 - .../testdata/annotations/annotations.pb.go | 16 - .../testdata/comments/comments.pb.go | 76 ---- .../testdata/comments/deprecated.pb.go | 14 - .../testdata/extensions/base/base.pb.go | 30 -- .../testdata/extensions/ext/ext.pb.go | 100 ----- .../testdata/extensions/extra/extra.pb.go | 14 - .../testdata/extensions/proto3/ext3.pb.go | 14 - .../testdata/fieldnames/fieldnames.pb.go | 26 -- .../testdata/import_public/a.pb.go | 14 - .../testdata/import_public/b.pb.go | 14 - .../testdata/import_public/c.pb.go | 14 - .../testdata/import_public/sub/a.pb.go | 28 -- .../testdata/import_public/sub/b.pb.go | 14 - .../testdata/import_public/sub2/a.pb.go | 14 - .../testdata/imports/fmt/m.pb.go | 14 - .../testdata/imports/test_a_1/m1.pb.go | 26 -- .../testdata/imports/test_a_1/m2.pb.go | 14 - .../testdata/imports/test_a_2/m3.pb.go | 14 - .../testdata/imports/test_a_2/m4.pb.go | 14 - .../testdata/imports/test_b_1/m1.pb.go | 14 - .../testdata/imports/test_b_1/m2.pb.go | 14 - .../testdata/imports/test_import_a1m1.pb.go | 14 - .../testdata/imports/test_import_a1m2.pb.go | 14 - .../testdata/imports/test_import_all.pb.go | 14 - .../issue780_oneof_conflict/test.pb.go | 14 - .../testdata/nopackage/nopackage.pb.go | 14 - cmd/protoc-gen-go/testdata/proto2/enum.pb.go | 26 -- .../testdata/proto2/fields.pb.go | 74 ---- .../testdata/proto2/nested_messages.pb.go | 38 -- .../testdata/proto2/proto2.pb.go | 14 - .../testdata/proto3/fields.pb.go | 26 -- .../testdata/protoeditions/enum.pb.go | 26 -- .../testdata/protoeditions/fields.pb.go | 74 ---- .../testdata/protoeditions/legacy_enum.pb.go | 14 - .../protoeditions/maps_and_delimited.pb.go | 26 -- .../protoeditions/nested_messages.pb.go | 38 -- .../testdata/retention/options_message.pb.go | 14 - .../testdata/retention/retention.pb.go | 42 -- integration_test.go | 1 - internal/impl/codec_reflect.go | 210 --------- internal/impl/codec_unsafe.go | 3 - internal/impl/message.go | 4 +- internal/impl/pointer_reflect.go | 215 --------- internal/impl/pointer_unsafe.go | 3 - internal/strs/strings_pure.go | 28 -- internal/strs/strings_unsafe_go120.go | 3 +- internal/strs/strings_unsafe_go121.go | 3 +- .../testprotos/benchmarks/micro/micro.pb.go | 14 - .../testprotos/conformance/conformance.pb.go | 50 --- .../editions/test_messages_edition2023.pb.go | 64 --- .../test_messages_proto2_editions.pb.go | 262 ----------- .../test_messages_proto3_editions.pb.go | 62 --- .../conformance/test_messages_proto2.pb.go | 262 ----------- .../conformance/test_messages_proto3.pb.go | 62 --- .../testprotos/editionsfuzztest/test2.pb.go | 62 --- .../editionsfuzztest/test2editions.pb.go | 62 --- .../testprotos/editionsfuzztest/test3.pb.go | 38 -- .../editionsfuzztest/test3editions.pb.go | 38 -- .../testprotos/fieldtrack/fieldtrack.pb.go | 16 - internal/testprotos/fuzz/fuzz.pb.go | 14 - internal/testprotos/irregular/test.pb.go | 14 - .../lazy_extension_normalized_wire_test.pb.go | 40 -- .../testprotos/lazy/lazy_extension_test.pb.go | 88 ---- internal/testprotos/legacy/legacy.pb.go | 14 - .../messageset/messagesetpb/message_set.pb.go | 28 -- .../messageset/msetextpb/msetextpb.pb.go | 50 --- internal/testprotos/news/news.pb.go | 38 -- internal/testprotos/order/order.pb.go | 16 - internal/testprotos/race/extender/test.pb.go | 14 - internal/testprotos/race/message/test.pb.go | 16 - internal/testprotos/registry/test.pb.go | 52 --- internal/testprotos/required/required.pb.go | 206 --------- internal/testprotos/test/test.pb.go | 334 -------------- internal/testprotos/test/test_import.pb.go | 14 - internal/testprotos/test/test_public.pb.go | 14 - .../testprotos/test/weak1/test_weak.pb.go | 14 - .../testprotos/test/weak2/test_weak.pb.go | 14 - internal/testprotos/test3/test.pb.go | 38 -- internal/testprotos/test3/test_import.pb.go | 14 - internal/testprotos/testeditions/test.pb.go | 160 ------- .../testeditions/test_extension.pb.go | 78 ---- .../testeditions/test_extension2.pb.go | 14 - internal/testprotos/textpb2/test.pb.go | 248 ----------- internal/testprotos/textpb3/test.pb.go | 110 ----- .../testprotos/textpbeditions/test2.pb.go | 284 ------------ reflect/protoreflect/value_pure.go | 60 --- reflect/protoreflect/value_unsafe_go120.go | 3 +- reflect/protoreflect/value_unsafe_go121.go | 3 +- types/descriptorpb/descriptor.pb.go | 418 ------------------ types/gofeaturespb/go_features.pb.go | 14 - types/known/anypb/any.pb.go | 14 - types/known/apipb/api.pb.go | 38 -- types/known/durationpb/duration.pb.go | 14 - types/known/emptypb/empty.pb.go | 14 - types/known/fieldmaskpb/field_mask.pb.go | 14 - .../sourcecontextpb/source_context.pb.go | 14 - types/known/structpb/struct.pb.go | 38 -- types/known/timestamppb/timestamp.pb.go | 14 - types/known/typepb/type.pb.go | 62 --- types/known/wrapperspb/wrappers.pb.go | 110 ----- types/pluginpb/plugin.pb.go | 50 --- 102 files changed, 6 insertions(+), 5263 deletions(-) delete mode 100644 internal/impl/codec_reflect.go delete mode 100644 internal/impl/pointer_reflect.go delete mode 100644 internal/strs/strings_pure.go delete mode 100644 reflect/protoreflect/value_pure.go diff --git a/cmd/protoc-gen-go/internal_gengo/reflect.go b/cmd/protoc-gen-go/internal_gengo/reflect.go index 4e9c9aea..419ed8a2 100644 --- a/cmd/protoc-gen-go/internal_gengo/reflect.go +++ b/cmd/protoc-gen-go/internal_gengo/reflect.go @@ -163,27 +163,6 @@ func genReflectFileDescriptor(gen *protogen.Plugin, g *protogen.GeneratedFile, f } if len(f.allMessages) > 0 { - // Populate MessageInfo.Exporters. - g.P("if !", protoimplPackage.Ident("UnsafeEnabled"), " {") - for _, message := range f.allMessages { - if sf := f.allMessageFieldsByPtr[message]; len(sf.unexported) > 0 { - idx := f.allMessagesByPtr[message] - typesVar := messageTypesVarName(f) - - g.P(typesVar, "[", idx, "].Exporter = func(v any, i int) any {") - g.P("switch v := v.(*", message.GoIdent, "); i {") - for i := 0; i < sf.count; i++ { - if name := sf.unexported[i]; name != "" { - g.P("case ", i, ": return &v.", name) - } - } - g.P("default: return nil") - g.P("}") - g.P("}") - } - } - g.P("}") - // Populate MessageInfo.OneofWrappers. for _, message := range f.allMessages { if len(message.Oneofs) > 0 { diff --git a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go index 1db210a1..323426d4 100644 --- a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go +++ b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go @@ -192,22 +192,6 @@ func file_cmd_protoc_gen_go_testdata_annotations_annotations_proto_init() { if File_cmd_protoc_gen_go_testdata_annotations_annotations_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_annotations_annotations_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*AnnotationsTestMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.weakFields - case 3: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/cmd/protoc-gen-go/testdata/comments/comments.pb.go b/cmd/protoc-gen-go/testdata/comments/comments.pb.go index 11c4461d..9002ba4a 100644 --- a/cmd/protoc-gen-go/testdata/comments/comments.pb.go +++ b/cmd/protoc-gen-go/testdata/comments/comments.pb.go @@ -441,82 +441,6 @@ func file_cmd_protoc_gen_go_testdata_comments_comments_proto_init() { if File_cmd_protoc_gen_go_testdata_comments_comments_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_comments_comments_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Message1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_comments_comments_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Message2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_comments_comments_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*Message1_Message1A); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_comments_comments_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*Message1_Message1B); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_comments_comments_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*Message2_Message2A); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_comments_comments_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*Message2_Message2B); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_cmd_protoc_gen_go_testdata_comments_comments_proto_msgTypes[0].OneofWrappers = []any{ (*Message1_Oneof1AField1)(nil), } diff --git a/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go b/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go index 9a8c8685..27526145 100644 --- a/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go +++ b/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go @@ -162,20 +162,6 @@ func file_cmd_protoc_gen_go_testdata_comments_deprecated_proto_init() { if File_cmd_protoc_gen_go_testdata_comments_deprecated_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_comments_deprecated_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*DeprecatedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 30a79930..17afef4c 100644 --- a/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go +++ b/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go @@ -153,36 +153,6 @@ func file_cmd_protoc_gen_go_testdata_extensions_base_base_proto_init() { if File_cmd_protoc_gen_go_testdata_extensions_base_base_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_extensions_base_base_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*BaseMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_extensions_base_base_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*MessageSetWireFormatMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 14eace61..32a8a8e2 100644 --- a/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go +++ b/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go @@ -1279,106 +1279,6 @@ func file_cmd_protoc_gen_go_testdata_extensions_ext_ext_proto_init() { if File_cmd_protoc_gen_go_testdata_extensions_ext_ext_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_extensions_ext_ext_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Message); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_extensions_ext_ext_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ExtensionGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_extensions_ext_ext_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*ExtendingMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_extensions_ext_ext_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*RepeatedGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_extensions_ext_ext_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*Extendable); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_extensions_ext_ext_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*MessageSetWireFormatExtension); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_extensions_ext_ext_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*Message_M); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_extensions_ext_ext_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*ExtendingMessage_ExtendingMessageSubmessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 71441c6b..c79f4de4 100644 --- a/cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go +++ b/cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go @@ -108,20 +108,6 @@ func file_cmd_protoc_gen_go_testdata_extensions_extra_extra_proto_init() { if File_cmd_protoc_gen_go_testdata_extensions_extra_extra_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_extensions_extra_extra_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*ExtraMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 e404679f..64af4075 100644 --- a/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go +++ b/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go @@ -725,20 +725,6 @@ func file_cmd_protoc_gen_go_testdata_extensions_proto3_ext3_proto_init() { if File_cmd_protoc_gen_go_testdata_extensions_proto3_ext3_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_extensions_proto3_ext3_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Message); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go b/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go index 2b063e1f..997a26c0 100644 --- a/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go +++ b/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go @@ -405,32 +405,6 @@ func file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_init() { if File_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Message); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Message_OneofMessageConflict); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_cmd_protoc_gen_go_testdata_fieldnames_fieldnames_proto_msgTypes[0].OneofWrappers = []any{ (*Message_OneofConflictA)(nil), (*Message_OneofNoConflict)(nil), 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 7153fe2f..4975c379 100644 --- a/cmd/protoc-gen-go/testdata/import_public/a.pb.go +++ b/cmd/protoc-gen-go/testdata/import_public/a.pb.go @@ -184,20 +184,6 @@ func file_cmd_protoc_gen_go_testdata_import_public_a_proto_init() { return } file_cmd_protoc_gen_go_testdata_import_public_b_proto_init() - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_import_public_a_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Public); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 b88b335e..f2eb62ee 100644 --- a/cmd/protoc-gen-go/testdata/import_public/b.pb.go +++ b/cmd/protoc-gen-go/testdata/import_public/b.pb.go @@ -128,20 +128,6 @@ func file_cmd_protoc_gen_go_testdata_import_public_b_proto_init() { if File_cmd_protoc_gen_go_testdata_import_public_b_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_import_public_b_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Local); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/cmd/protoc-gen-go/testdata/import_public/c.pb.go b/cmd/protoc-gen-go/testdata/import_public/c.pb.go index bef79607..b1fedd3c 100644 --- a/cmd/protoc-gen-go/testdata/import_public/c.pb.go +++ b/cmd/protoc-gen-go/testdata/import_public/c.pb.go @@ -134,20 +134,6 @@ func file_cmd_protoc_gen_go_testdata_import_public_c_proto_init() { return } file_cmd_protoc_gen_go_testdata_import_public_a_proto_init() - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_import_public_c_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*UsingPublicImport); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 c347ddb5..d81e536b 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 @@ -497,34 +497,6 @@ func file_cmd_protoc_gen_go_testdata_import_public_sub_a_proto_init() { return } file_cmd_protoc_gen_go_testdata_import_public_sub_b_proto_init() - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_import_public_sub_a_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*M); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_import_public_sub_a_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*M_Submessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_cmd_protoc_gen_go_testdata_import_public_sub_a_proto_msgTypes[0].OneofWrappers = []any{ (*M_OneofInt32)(nil), (*M_OneofInt64)(nil), 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 60e73a4f..cb011dfd 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 @@ -97,20 +97,6 @@ func file_cmd_protoc_gen_go_testdata_import_public_sub_b_proto_init() { if File_cmd_protoc_gen_go_testdata_import_public_sub_b_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_import_public_sub_b_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*M2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 fef44e5c..fb46946b 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 @@ -98,20 +98,6 @@ func file_cmd_protoc_gen_go_testdata_import_public_sub2_a_proto_init() { if File_cmd_protoc_gen_go_testdata_import_public_sub2_a_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_import_public_sub2_a_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Sub2Message); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 32445346..f7175862 100644 --- a/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go +++ b/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go @@ -95,20 +95,6 @@ func file_cmd_protoc_gen_go_testdata_imports_fmt_m_proto_init() { if File_cmd_protoc_gen_go_testdata_imports_fmt_m_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_imports_fmt_m_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*M); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 2c07d658..1c4e1e3c 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 @@ -193,32 +193,6 @@ func file_cmd_protoc_gen_go_testdata_imports_test_a_1_m1_proto_init() { if File_cmd_protoc_gen_go_testdata_imports_test_a_1_m1_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_imports_test_a_1_m1_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*M1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_imports_test_a_1_m1_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*M1_1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 3f6ce922..a498ea1f 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 @@ -96,20 +96,6 @@ func file_cmd_protoc_gen_go_testdata_imports_test_a_1_m2_proto_init() { if File_cmd_protoc_gen_go_testdata_imports_test_a_1_m2_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_imports_test_a_1_m2_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*M2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 22b8cfa9..504d28ce 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 @@ -96,20 +96,6 @@ func file_cmd_protoc_gen_go_testdata_imports_test_a_2_m3_proto_init() { if File_cmd_protoc_gen_go_testdata_imports_test_a_2_m3_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_imports_test_a_2_m3_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*M3); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 ea814415..bd61016f 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 @@ -96,20 +96,6 @@ func file_cmd_protoc_gen_go_testdata_imports_test_a_2_m4_proto_init() { if File_cmd_protoc_gen_go_testdata_imports_test_a_2_m4_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_imports_test_a_2_m4_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*M4); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 30dc8c25..af09fd44 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 @@ -97,20 +97,6 @@ func file_cmd_protoc_gen_go_testdata_imports_test_b_1_m1_proto_init() { if File_cmd_protoc_gen_go_testdata_imports_test_b_1_m1_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_imports_test_b_1_m1_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*M1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 16b6a1c5..04ff330a 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 @@ -97,20 +97,6 @@ func file_cmd_protoc_gen_go_testdata_imports_test_b_1_m2_proto_init() { if File_cmd_protoc_gen_go_testdata_imports_test_b_1_m2_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_imports_test_b_1_m2_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*M2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 94f4aeef..d48e7aff 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 @@ -113,20 +113,6 @@ func file_cmd_protoc_gen_go_testdata_imports_test_import_a1m1_proto_init() { if File_cmd_protoc_gen_go_testdata_imports_test_import_a1m1_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_imports_test_import_a1m1_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*A1M1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 6a5dfa3c..22d34159 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 @@ -113,20 +113,6 @@ func file_cmd_protoc_gen_go_testdata_imports_test_import_a1m2_proto_init() { if File_cmd_protoc_gen_go_testdata_imports_test_import_a1m2_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_imports_test_import_a1m2_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*A1M2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 235d2dff..374e1c76 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 @@ -184,20 +184,6 @@ func file_cmd_protoc_gen_go_testdata_imports_test_import_all_proto_init() { if File_cmd_protoc_gen_go_testdata_imports_test_import_all_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_imports_test_import_all_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*All); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ 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 5d5310ce..f6dd1e00 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 @@ -128,20 +128,6 @@ func file_cmd_protoc_gen_go_testdata_issue780_oneof_conflict_test_proto_init() { if File_cmd_protoc_gen_go_testdata_issue780_oneof_conflict_test_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_issue780_oneof_conflict_test_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Foo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_cmd_protoc_gen_go_testdata_issue780_oneof_conflict_test_proto_msgTypes[0].OneofWrappers = []any{ (*Foo_GetBar)(nil), } diff --git a/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go b/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go index 65053d44..e528850b 100644 --- a/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go +++ b/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go @@ -175,20 +175,6 @@ func file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_init() { if File_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Message); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/cmd/protoc-gen-go/testdata/proto2/enum.pb.go b/cmd/protoc-gen-go/testdata/proto2/enum.pb.go index 82de1ed1..f0f5a563 100644 --- a/cmd/protoc-gen-go/testdata/proto2/enum.pb.go +++ b/cmd/protoc-gen-go/testdata/proto2/enum.pb.go @@ -529,32 +529,6 @@ func file_cmd_protoc_gen_go_testdata_proto2_enum_proto_init() { if File_cmd_protoc_gen_go_testdata_proto2_enum_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_proto2_enum_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*EnumContainerMessage1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_proto2_enum_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*EnumContainerMessage1_EnumContainerMessage2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/cmd/protoc-gen-go/testdata/proto2/fields.pb.go b/cmd/protoc-gen-go/testdata/proto2/fields.pb.go index 9cd0c687..5f264e3f 100644 --- a/cmd/protoc-gen-go/testdata/proto2/fields.pb.go +++ b/cmd/protoc-gen-go/testdata/proto2/fields.pb.go @@ -1772,80 +1772,6 @@ func file_cmd_protoc_gen_go_testdata_proto2_fields_proto_init() { if File_cmd_protoc_gen_go_testdata_proto2_fields_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_proto2_fields_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*FieldTestMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_proto2_fields_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*FieldTestMessage_OptionalGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_proto2_fields_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*FieldTestMessage_RequiredGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_proto2_fields_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*FieldTestMessage_RepeatedGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_proto2_fields_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*FieldTestMessage_OneofGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_proto2_fields_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*FieldTestMessage_Message); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_cmd_protoc_gen_go_testdata_proto2_fields_proto_msgTypes[0].OneofWrappers = []any{ (*FieldTestMessage_OneofBool)(nil), (*FieldTestMessage_OneofEnum)(nil), 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 7e975822..9c9f1ca3 100644 --- a/cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go +++ b/cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go @@ -215,44 +215,6 @@ func file_cmd_protoc_gen_go_testdata_proto2_nested_messages_proto_init() { if File_cmd_protoc_gen_go_testdata_proto2_nested_messages_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_proto2_nested_messages_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Layer1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_proto2_nested_messages_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Layer1_Layer2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_proto2_nested_messages_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*Layer1_Layer2_Layer3); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go b/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go index 78e935ca..b97348de 100644 --- a/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go +++ b/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go @@ -118,20 +118,6 @@ func file_cmd_protoc_gen_go_testdata_proto2_proto2_proto_init() { if File_cmd_protoc_gen_go_testdata_proto2_proto2_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_proto2_proto2_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Message); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/cmd/protoc-gen-go/testdata/proto3/fields.pb.go b/cmd/protoc-gen-go/testdata/proto3/fields.pb.go index 08100f87..60485aeb 100644 --- a/cmd/protoc-gen-go/testdata/proto3/fields.pb.go +++ b/cmd/protoc-gen-go/testdata/proto3/fields.pb.go @@ -630,32 +630,6 @@ func file_cmd_protoc_gen_go_testdata_proto3_fields_proto_init() { if File_cmd_protoc_gen_go_testdata_proto3_fields_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_proto3_fields_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*FieldTestMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_proto3_fields_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*FieldTestMessage_Message); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/cmd/protoc-gen-go/testdata/protoeditions/enum.pb.go b/cmd/protoc-gen-go/testdata/protoeditions/enum.pb.go index da3875dd..2ebfce98 100644 --- a/cmd/protoc-gen-go/testdata/protoeditions/enum.pb.go +++ b/cmd/protoc-gen-go/testdata/protoeditions/enum.pb.go @@ -539,32 +539,6 @@ func file_cmd_protoc_gen_go_testdata_protoeditions_enum_proto_init() { if File_cmd_protoc_gen_go_testdata_protoeditions_enum_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_protoeditions_enum_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*EnumContainerMessage1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_protoeditions_enum_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*EnumContainerMessage1_EnumContainerMessage2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/cmd/protoc-gen-go/testdata/protoeditions/fields.pb.go b/cmd/protoc-gen-go/testdata/protoeditions/fields.pb.go index e3c9ec0a..3a0e36ee 100644 --- a/cmd/protoc-gen-go/testdata/protoeditions/fields.pb.go +++ b/cmd/protoc-gen-go/testdata/protoeditions/fields.pb.go @@ -1781,80 +1781,6 @@ func file_cmd_protoc_gen_go_testdata_protoeditions_fields_proto_init() { if File_cmd_protoc_gen_go_testdata_protoeditions_fields_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_protoeditions_fields_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*FieldTestMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_protoeditions_fields_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*FieldTestMessage_OptionalGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_protoeditions_fields_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*FieldTestMessage_RequiredGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_protoeditions_fields_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*FieldTestMessage_RepeatedGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_protoeditions_fields_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*FieldTestMessage_OneofGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_protoeditions_fields_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*FieldTestMessage_Message); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_cmd_protoc_gen_go_testdata_protoeditions_fields_proto_msgTypes[0].OneofWrappers = []any{ (*FieldTestMessage_OneofBool)(nil), (*FieldTestMessage_OneofEnum)(nil), diff --git a/cmd/protoc-gen-go/testdata/protoeditions/legacy_enum.pb.go b/cmd/protoc-gen-go/testdata/protoeditions/legacy_enum.pb.go index 916f5dc1..1b640e10 100644 --- a/cmd/protoc-gen-go/testdata/protoeditions/legacy_enum.pb.go +++ b/cmd/protoc-gen-go/testdata/protoeditions/legacy_enum.pb.go @@ -284,20 +284,6 @@ func file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_init() { if File_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_protoeditions_legacy_enum_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*ContainerForNestedEnum); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/cmd/protoc-gen-go/testdata/protoeditions/maps_and_delimited.pb.go b/cmd/protoc-gen-go/testdata/protoeditions/maps_and_delimited.pb.go index 19956bbf..5d3f602b 100644 --- a/cmd/protoc-gen-go/testdata/protoeditions/maps_and_delimited.pb.go +++ b/cmd/protoc-gen-go/testdata/protoeditions/maps_and_delimited.pb.go @@ -260,32 +260,6 @@ func file_cmd_protoc_gen_go_testdata_protoeditions_maps_and_delimited_proto_init if File_cmd_protoc_gen_go_testdata_protoeditions_maps_and_delimited_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_protoeditions_maps_and_delimited_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*MessageWithMaps); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_protoeditions_maps_and_delimited_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*MessageWithMaps_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/cmd/protoc-gen-go/testdata/protoeditions/nested_messages.pb.go b/cmd/protoc-gen-go/testdata/protoeditions/nested_messages.pb.go index 148e1587..f0ef5d8a 100644 --- a/cmd/protoc-gen-go/testdata/protoeditions/nested_messages.pb.go +++ b/cmd/protoc-gen-go/testdata/protoeditions/nested_messages.pb.go @@ -219,44 +219,6 @@ func file_cmd_protoc_gen_go_testdata_protoeditions_nested_messages_proto_init() if File_cmd_protoc_gen_go_testdata_protoeditions_nested_messages_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_protoeditions_nested_messages_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Layer1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_protoeditions_nested_messages_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Layer1_Layer2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_protoeditions_nested_messages_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*Layer1_Layer2_Layer3); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/cmd/protoc-gen-go/testdata/retention/options_message.pb.go b/cmd/protoc-gen-go/testdata/retention/options_message.pb.go index 5b25c42d..149142a7 100755 --- a/cmd/protoc-gen-go/testdata/retention/options_message.pb.go +++ b/cmd/protoc-gen-go/testdata/retention/options_message.pb.go @@ -214,20 +214,6 @@ func file_cmd_protoc_gen_go_testdata_retention_options_message_proto_init() { if File_cmd_protoc_gen_go_testdata_retention_options_message_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_retention_options_message_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*OptionsMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/cmd/protoc-gen-go/testdata/retention/retention.pb.go b/cmd/protoc-gen-go/testdata/retention/retention.pb.go index 2b9ea040..cd5b5da5 100755 --- a/cmd/protoc-gen-go/testdata/retention/retention.pb.go +++ b/cmd/protoc-gen-go/testdata/retention/retention.pb.go @@ -657,48 +657,6 @@ func file_cmd_protoc_gen_go_testdata_retention_retention_proto_init() { return } file_cmd_protoc_gen_go_testdata_retention_options_message_proto_init() - if !protoimpl.UnsafeEnabled { - file_cmd_protoc_gen_go_testdata_retention_retention_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Extendee); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_retention_retention_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*TopLevelMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_cmd_protoc_gen_go_testdata_retention_retention_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*TopLevelMessage_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_cmd_protoc_gen_go_testdata_retention_retention_proto_msgTypes[1].OneofWrappers = []any{ (*TopLevelMessage_I)(nil), } diff --git a/integration_test.go b/integration_test.go index 9272d73f..fd767d1b 100644 --- a/integration_test.go +++ b/integration_test.go @@ -140,7 +140,6 @@ func TestIntegration(t *testing.T) { } runGo("Normal", command{}, "go", "test", "-race", "./...") - runGo("PureGo", command{}, "go", "test", "-race", "-tags", "purego", "./...") runGo("Reflect", command{}, "go", "test", "-race", "-tags", "protoreflect", "./...") if goVersion == golangLatest { runGo("ProtoLegacyRace", command{}, "go", "test", "-race", "-tags", "protolegacy", "./...") diff --git a/internal/impl/codec_reflect.go b/internal/impl/codec_reflect.go deleted file mode 100644 index 145c577b..00000000 --- a/internal/impl/codec_reflect.go +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build purego || appengine -// +build purego appengine - -package impl - -import ( - "reflect" - - "google.golang.org/protobuf/encoding/protowire" -) - -func sizeEnum(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) { - v := p.v.Elem().Int() - return f.tagsize + protowire.SizeVarint(uint64(v)) -} - -func appendEnum(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { - v := p.v.Elem().Int() - b = protowire.AppendVarint(b, f.wiretag) - b = protowire.AppendVarint(b, uint64(v)) - return b, nil -} - -func consumeEnum(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) { - if wtyp != protowire.VarintType { - return out, errUnknown - } - v, n := protowire.ConsumeVarint(b) - if n < 0 { - return out, errDecode - } - p.v.Elem().SetInt(int64(v)) - out.n = n - return out, nil -} - -func mergeEnum(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { - dst.v.Elem().Set(src.v.Elem()) -} - -var coderEnum = pointerCoderFuncs{ - size: sizeEnum, - marshal: appendEnum, - unmarshal: consumeEnum, - merge: mergeEnum, -} - -func sizeEnumNoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { - if p.v.Elem().Int() == 0 { - return 0 - } - return sizeEnum(p, f, opts) -} - -func appendEnumNoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { - if p.v.Elem().Int() == 0 { - return b, nil - } - return appendEnum(b, p, f, opts) -} - -func mergeEnumNoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { - if src.v.Elem().Int() != 0 { - dst.v.Elem().Set(src.v.Elem()) - } -} - -var coderEnumNoZero = pointerCoderFuncs{ - size: sizeEnumNoZero, - marshal: appendEnumNoZero, - unmarshal: consumeEnum, - merge: mergeEnumNoZero, -} - -func sizeEnumPtr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { - return sizeEnum(pointer{p.v.Elem()}, f, opts) -} - -func appendEnumPtr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { - return appendEnum(b, pointer{p.v.Elem()}, f, opts) -} - -func consumeEnumPtr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { - if wtyp != protowire.VarintType { - return out, errUnknown - } - if p.v.Elem().IsNil() { - p.v.Elem().Set(reflect.New(p.v.Elem().Type().Elem())) - } - return consumeEnum(b, pointer{p.v.Elem()}, wtyp, f, opts) -} - -func mergeEnumPtr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { - if !src.v.Elem().IsNil() { - v := reflect.New(dst.v.Type().Elem().Elem()) - v.Elem().Set(src.v.Elem().Elem()) - dst.v.Elem().Set(v) - } -} - -var coderEnumPtr = pointerCoderFuncs{ - size: sizeEnumPtr, - marshal: appendEnumPtr, - unmarshal: consumeEnumPtr, - merge: mergeEnumPtr, -} - -func sizeEnumSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { - s := p.v.Elem() - for i, llen := 0, s.Len(); i < llen; i++ { - size += protowire.SizeVarint(uint64(s.Index(i).Int())) + f.tagsize - } - return size -} - -func appendEnumSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { - s := p.v.Elem() - for i, llen := 0, s.Len(); i < llen; i++ { - b = protowire.AppendVarint(b, f.wiretag) - b = protowire.AppendVarint(b, uint64(s.Index(i).Int())) - } - return b, nil -} - -func consumeEnumSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { - s := p.v.Elem() - if wtyp == protowire.BytesType { - b, n := protowire.ConsumeBytes(b) - if n < 0 { - return out, errDecode - } - for len(b) > 0 { - v, n := protowire.ConsumeVarint(b) - if n < 0 { - return out, errDecode - } - rv := reflect.New(s.Type().Elem()).Elem() - rv.SetInt(int64(v)) - s.Set(reflect.Append(s, rv)) - b = b[n:] - } - out.n = n - return out, nil - } - if wtyp != protowire.VarintType { - return out, errUnknown - } - v, n := protowire.ConsumeVarint(b) - if n < 0 { - return out, errDecode - } - rv := reflect.New(s.Type().Elem()).Elem() - rv.SetInt(int64(v)) - s.Set(reflect.Append(s, rv)) - out.n = n - return out, nil -} - -func mergeEnumSlice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { - dst.v.Elem().Set(reflect.AppendSlice(dst.v.Elem(), src.v.Elem())) -} - -var coderEnumSlice = pointerCoderFuncs{ - size: sizeEnumSlice, - marshal: appendEnumSlice, - unmarshal: consumeEnumSlice, - merge: mergeEnumSlice, -} - -func sizeEnumPackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) { - s := p.v.Elem() - llen := s.Len() - if llen == 0 { - return 0 - } - n := 0 - for i := 0; i < llen; i++ { - n += protowire.SizeVarint(uint64(s.Index(i).Int())) - } - return f.tagsize + protowire.SizeBytes(n) -} - -func appendEnumPackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) { - s := p.v.Elem() - llen := s.Len() - if llen == 0 { - return b, nil - } - b = protowire.AppendVarint(b, f.wiretag) - n := 0 - for i := 0; i < llen; i++ { - n += protowire.SizeVarint(uint64(s.Index(i).Int())) - } - b = protowire.AppendVarint(b, uint64(n)) - for i := 0; i < llen; i++ { - b = protowire.AppendVarint(b, uint64(s.Index(i).Int())) - } - return b, nil -} - -var coderEnumPackedSlice = pointerCoderFuncs{ - size: sizeEnumPackedSlice, - marshal: appendEnumPackedSlice, - unmarshal: consumeEnumSlice, - merge: mergeEnumSlice, -} diff --git a/internal/impl/codec_unsafe.go b/internal/impl/codec_unsafe.go index 757642e2..077712c2 100644 --- a/internal/impl/codec_unsafe.go +++ b/internal/impl/codec_unsafe.go @@ -2,9 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !purego && !appengine -// +build !purego,!appengine - package impl // When using unsafe pointers, we can just treat enum values as int32s. diff --git a/internal/impl/message.go b/internal/impl/message.go index 019399d4..741b5ed2 100644 --- a/internal/impl/message.go +++ b/internal/impl/message.go @@ -30,8 +30,8 @@ type MessageInfo struct { // Desc is the underlying message descriptor type and must be populated. Desc protoreflect.MessageDescriptor - // Exporter must be provided in a purego environment in order to provide - // access to unexported fields. + // Deprecated: Exporter will be removed the next time we bump + // protoimpl.GenVersion. See https://github.com/golang/protobuf/issues/1640 Exporter exporter // OneofWrappers is list of pointers to oneof wrapper struct types. diff --git a/internal/impl/pointer_reflect.go b/internal/impl/pointer_reflect.go deleted file mode 100644 index da685e8a..00000000 --- a/internal/impl/pointer_reflect.go +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build purego || appengine -// +build purego appengine - -package impl - -import ( - "fmt" - "reflect" - "sync" -) - -const UnsafeEnabled = false - -// Pointer is an opaque pointer type. -type Pointer any - -// offset represents the offset to a struct field, accessible from a pointer. -// The offset is the field index into a struct. -type offset struct { - index int - export exporter -} - -// offsetOf returns a field offset for the struct field. -func offsetOf(f reflect.StructField, x exporter) offset { - if len(f.Index) != 1 { - panic("embedded structs are not supported") - } - if f.PkgPath == "" { - return offset{index: f.Index[0]} // field is already exported - } - if x == nil { - panic("exporter must be provided for unexported field") - } - return offset{index: f.Index[0], export: x} -} - -// IsValid reports whether the offset is valid. -func (f offset) IsValid() bool { return f.index >= 0 } - -// invalidOffset is an invalid field offset. -var invalidOffset = offset{index: -1} - -// zeroOffset is a noop when calling pointer.Apply. -var zeroOffset = offset{index: 0} - -// pointer is an abstract representation of a pointer to a struct or field. -type pointer struct{ v reflect.Value } - -// pointerOf returns p as a pointer. -func pointerOf(p Pointer) pointer { - return pointerOfIface(p) -} - -// pointerOfValue returns v as a pointer. -func pointerOfValue(v reflect.Value) pointer { - return pointer{v: v} -} - -// pointerOfIface returns the pointer portion of an interface. -func pointerOfIface(v any) pointer { - return pointer{v: reflect.ValueOf(v)} -} - -// IsNil reports whether the pointer is nil. -func (p pointer) IsNil() bool { - return p.v.IsNil() -} - -// Apply adds an offset to the pointer to derive a new pointer -// to a specified field. The current pointer must be pointing at a struct. -func (p pointer) Apply(f offset) pointer { - if f.export != nil { - if v := reflect.ValueOf(f.export(p.v.Interface(), f.index)); v.IsValid() { - return pointer{v: v} - } - } - return pointer{v: p.v.Elem().Field(f.index).Addr()} -} - -// AsValueOf treats p as a pointer to an object of type t and returns the value. -// It is equivalent to reflect.ValueOf(p.AsIfaceOf(t)) -func (p pointer) AsValueOf(t reflect.Type) reflect.Value { - if got := p.v.Type().Elem(); got != t { - panic(fmt.Sprintf("invalid type: got %v, want %v", got, t)) - } - return p.v -} - -// AsIfaceOf treats p as a pointer to an object of type t and returns the value. -// It is equivalent to p.AsValueOf(t).Interface() -func (p pointer) AsIfaceOf(t reflect.Type) any { - return p.AsValueOf(t).Interface() -} - -func (p pointer) Bool() *bool { return p.v.Interface().(*bool) } -func (p pointer) BoolPtr() **bool { return p.v.Interface().(**bool) } -func (p pointer) BoolSlice() *[]bool { return p.v.Interface().(*[]bool) } -func (p pointer) Int32() *int32 { return p.v.Interface().(*int32) } -func (p pointer) Int32Ptr() **int32 { return p.v.Interface().(**int32) } -func (p pointer) Int32Slice() *[]int32 { return p.v.Interface().(*[]int32) } -func (p pointer) Int64() *int64 { return p.v.Interface().(*int64) } -func (p pointer) Int64Ptr() **int64 { return p.v.Interface().(**int64) } -func (p pointer) Int64Slice() *[]int64 { return p.v.Interface().(*[]int64) } -func (p pointer) Uint32() *uint32 { return p.v.Interface().(*uint32) } -func (p pointer) Uint32Ptr() **uint32 { return p.v.Interface().(**uint32) } -func (p pointer) Uint32Slice() *[]uint32 { return p.v.Interface().(*[]uint32) } -func (p pointer) Uint64() *uint64 { return p.v.Interface().(*uint64) } -func (p pointer) Uint64Ptr() **uint64 { return p.v.Interface().(**uint64) } -func (p pointer) Uint64Slice() *[]uint64 { return p.v.Interface().(*[]uint64) } -func (p pointer) Float32() *float32 { return p.v.Interface().(*float32) } -func (p pointer) Float32Ptr() **float32 { return p.v.Interface().(**float32) } -func (p pointer) Float32Slice() *[]float32 { return p.v.Interface().(*[]float32) } -func (p pointer) Float64() *float64 { return p.v.Interface().(*float64) } -func (p pointer) Float64Ptr() **float64 { return p.v.Interface().(**float64) } -func (p pointer) Float64Slice() *[]float64 { return p.v.Interface().(*[]float64) } -func (p pointer) String() *string { return p.v.Interface().(*string) } -func (p pointer) StringPtr() **string { return p.v.Interface().(**string) } -func (p pointer) StringSlice() *[]string { return p.v.Interface().(*[]string) } -func (p pointer) Bytes() *[]byte { return p.v.Interface().(*[]byte) } -func (p pointer) BytesPtr() **[]byte { return p.v.Interface().(**[]byte) } -func (p pointer) BytesSlice() *[][]byte { return p.v.Interface().(*[][]byte) } -func (p pointer) WeakFields() *weakFields { return (*weakFields)(p.v.Interface().(*WeakFields)) } -func (p pointer) Extensions() *map[int32]ExtensionField { - return p.v.Interface().(*map[int32]ExtensionField) -} - -func (p pointer) Elem() pointer { - return pointer{v: p.v.Elem()} -} - -// PointerSlice copies []*T from p as a new []pointer. -// This behavior differs from the implementation in pointer_unsafe.go. -func (p pointer) PointerSlice() []pointer { - // TODO: reconsider this - if p.v.IsNil() { - return nil - } - n := p.v.Elem().Len() - s := make([]pointer, n) - for i := 0; i < n; i++ { - s[i] = pointer{v: p.v.Elem().Index(i)} - } - return s -} - -// AppendPointerSlice appends v to p, which must be a []*T. -func (p pointer) AppendPointerSlice(v pointer) { - sp := p.v.Elem() - sp.Set(reflect.Append(sp, v.v)) -} - -// SetPointer sets *p to v. -func (p pointer) SetPointer(v pointer) { - p.v.Elem().Set(v.v) -} - -func growSlice(p pointer, addCap int) { - // TODO: Once we only support Go 1.20 and newer, use reflect.Grow. - in := p.v.Elem() - out := reflect.MakeSlice(in.Type(), in.Len(), in.Len()+addCap) - reflect.Copy(out, in) - p.v.Elem().Set(out) -} - -func (p pointer) growBoolSlice(addCap int) { - growSlice(p, addCap) -} - -func (p pointer) growInt32Slice(addCap int) { - growSlice(p, addCap) -} - -func (p pointer) growUint32Slice(addCap int) { - growSlice(p, addCap) -} - -func (p pointer) growInt64Slice(addCap int) { - growSlice(p, addCap) -} - -func (p pointer) growUint64Slice(addCap int) { - growSlice(p, addCap) -} - -func (p pointer) growFloat64Slice(addCap int) { - growSlice(p, addCap) -} - -func (p pointer) growFloat32Slice(addCap int) { - growSlice(p, addCap) -} - -func (Export) MessageStateOf(p Pointer) *messageState { panic("not supported") } -func (ms *messageState) pointer() pointer { panic("not supported") } -func (ms *messageState) messageInfo() *MessageInfo { panic("not supported") } -func (ms *messageState) LoadMessageInfo() *MessageInfo { panic("not supported") } -func (ms *messageState) StoreMessageInfo(mi *MessageInfo) { panic("not supported") } - -type atomicNilMessage struct { - once sync.Once - m messageReflectWrapper -} - -func (m *atomicNilMessage) Init(mi *MessageInfo) *messageReflectWrapper { - m.once.Do(func() { - m.m.p = pointerOfIface(reflect.Zero(mi.GoReflectType).Interface()) - m.m.mi = mi - }) - return &m.m -} diff --git a/internal/impl/pointer_unsafe.go b/internal/impl/pointer_unsafe.go index 5f20ca5d..79e18666 100644 --- a/internal/impl/pointer_unsafe.go +++ b/internal/impl/pointer_unsafe.go @@ -2,9 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !purego && !appengine -// +build !purego,!appengine - package impl import ( diff --git a/internal/strs/strings_pure.go b/internal/strs/strings_pure.go deleted file mode 100644 index a1f6f333..00000000 --- a/internal/strs/strings_pure.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build purego || appengine -// +build purego appengine - -package strs - -import pref "google.golang.org/protobuf/reflect/protoreflect" - -func UnsafeString(b []byte) string { - return string(b) -} - -func UnsafeBytes(s string) []byte { - return []byte(s) -} - -type Builder struct{} - -func (*Builder) AppendFullName(prefix pref.FullName, name pref.Name) pref.FullName { - return prefix.Append(name) -} - -func (*Builder) MakeString(b []byte) string { - return string(b) -} diff --git a/internal/strs/strings_unsafe_go120.go b/internal/strs/strings_unsafe_go120.go index a008acd0..832a7988 100644 --- a/internal/strs/strings_unsafe_go120.go +++ b/internal/strs/strings_unsafe_go120.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !purego && !appengine && !go1.21 -// +build !purego,!appengine,!go1.21 +//go:build !go1.21 package strs diff --git a/internal/strs/strings_unsafe_go121.go b/internal/strs/strings_unsafe_go121.go index 60166f2b..1ffddf68 100644 --- a/internal/strs/strings_unsafe_go121.go +++ b/internal/strs/strings_unsafe_go121.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !purego && !appengine && go1.21 -// +build !purego,!appengine,go1.21 +//go:build go1.21 package strs diff --git a/internal/testprotos/benchmarks/micro/micro.pb.go b/internal/testprotos/benchmarks/micro/micro.pb.go index 3dd3da37..b0326c28 100644 --- a/internal/testprotos/benchmarks/micro/micro.pb.go +++ b/internal/testprotos/benchmarks/micro/micro.pb.go @@ -243,20 +243,6 @@ func file_internal_testprotos_benchmarks_micro_micro_proto_init() { if File_internal_testprotos_benchmarks_micro_micro_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_benchmarks_micro_micro_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*SixteenRequired); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/conformance/conformance.pb.go b/internal/testprotos/conformance/conformance.pb.go index b8f904f0..83514357 100644 --- a/internal/testprotos/conformance/conformance.pb.go +++ b/internal/testprotos/conformance/conformance.pb.go @@ -738,56 +738,6 @@ func file_conformance_conformance_proto_init() { if File_conformance_conformance_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_conformance_conformance_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*FailureSet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_conformance_conformance_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ConformanceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_conformance_conformance_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*ConformanceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_conformance_conformance_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*JspbEncodingConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_conformance_conformance_proto_msgTypes[1].OneofWrappers = []any{ (*ConformanceRequest_ProtobufPayload)(nil), (*ConformanceRequest_JsonPayload)(nil), diff --git a/internal/testprotos/conformance/editions/test_messages_edition2023.pb.go b/internal/testprotos/conformance/editions/test_messages_edition2023.pb.go index 6ccaa410..f845b42f 100644 --- a/internal/testprotos/conformance/editions/test_messages_edition2023.pb.go +++ b/internal/testprotos/conformance/editions/test_messages_edition2023.pb.go @@ -1983,70 +1983,6 @@ func file_conformance_test_protos_test_messages_edition2023_proto_init() { if File_conformance_test_protos_test_messages_edition2023_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_conformance_test_protos_test_messages_edition2023_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesEdition2023); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_conformance_test_protos_test_messages_edition2023_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ForeignMessageEdition2023); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_conformance_test_protos_test_messages_edition2023_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*GroupLikeType); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_conformance_test_protos_test_messages_edition2023_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesEdition2023_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_conformance_test_protos_test_messages_edition2023_proto_msgTypes[23].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesEdition2023_GroupLikeType); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_conformance_test_protos_test_messages_edition2023_proto_msgTypes[0].OneofWrappers = []any{ (*TestAllTypesEdition2023_OneofUint32)(nil), (*TestAllTypesEdition2023_OneofNestedMessage)(nil), diff --git a/internal/testprotos/conformance/editionsmigration/test_messages_proto2_editions.pb.go b/internal/testprotos/conformance/editionsmigration/test_messages_proto2_editions.pb.go index bf2f28e0..193c6e13 100644 --- a/internal/testprotos/conformance/editionsmigration/test_messages_proto2_editions.pb.go +++ b/internal/testprotos/conformance/editionsmigration/test_messages_proto2_editions.pb.go @@ -4008,268 +4008,6 @@ func file_editions_golden_test_messages_proto2_editions_proto_init() { if File_editions_golden_test_messages_proto2_editions_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ForeignMessageProto2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*GroupField); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*UnknownToTestAllTypes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*NullHypothesisProto2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*EnumOnlyProto2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*OneStringProto2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*ProtoWithKeywords); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*TestAllRequiredTypesProto2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[29].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2_Data); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[30].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2_MultiWordGroupField); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[31].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2_MessageSetCorrect); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[32].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2_MessageSetCorrectExtension1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[33].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2_MessageSetCorrectExtension2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[34].Exporter = func(v any, i int) any { - switch v := v.(*UnknownToTestAllTypes_OptionalGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[35].Exporter = func(v any, i int) any { - switch v := v.(*TestAllRequiredTypesProto2_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[36].Exporter = func(v any, i int) any { - switch v := v.(*TestAllRequiredTypesProto2_Data); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[37].Exporter = func(v any, i int) any { - switch v := v.(*TestAllRequiredTypesProto2_MessageSetCorrect); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[38].Exporter = func(v any, i int) any { - switch v := v.(*TestAllRequiredTypesProto2_MessageSetCorrectExtension1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto2_editions_proto_msgTypes[39].Exporter = func(v any, i int) any { - switch v := v.(*TestAllRequiredTypesProto2_MessageSetCorrectExtension2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_editions_golden_test_messages_proto2_editions_proto_msgTypes[0].OneofWrappers = []any{ (*TestAllTypesProto2_OneofUint32)(nil), (*TestAllTypesProto2_OneofNestedMessage)(nil), diff --git a/internal/testprotos/conformance/editionsmigration/test_messages_proto3_editions.pb.go b/internal/testprotos/conformance/editionsmigration/test_messages_proto3_editions.pb.go index 07e5a648..1c4f457f 100644 --- a/internal/testprotos/conformance/editionsmigration/test_messages_proto3_editions.pb.go +++ b/internal/testprotos/conformance/editionsmigration/test_messages_proto3_editions.pb.go @@ -2683,68 +2683,6 @@ func file_editions_golden_test_messages_proto3_editions_proto_init() { if File_editions_golden_test_messages_proto3_editions_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_editions_golden_test_messages_proto3_editions_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto3); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto3_editions_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ForeignMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto3_editions_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*NullHypothesisProto3); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto3_editions_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*EnumOnlyProto3); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_editions_golden_test_messages_proto3_editions_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto3_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_editions_golden_test_messages_proto3_editions_proto_msgTypes[0].OneofWrappers = []any{ (*TestAllTypesProto3_OneofUint32)(nil), (*TestAllTypesProto3_OneofNestedMessage)(nil), diff --git a/internal/testprotos/conformance/test_messages_proto2.pb.go b/internal/testprotos/conformance/test_messages_proto2.pb.go index 81921ee6..aececaa7 100644 --- a/internal/testprotos/conformance/test_messages_proto2.pb.go +++ b/internal/testprotos/conformance/test_messages_proto2.pb.go @@ -3991,268 +3991,6 @@ func file_google_protobuf_test_messages_proto2_proto_init() { if File_google_protobuf_test_messages_proto2_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_test_messages_proto2_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ForeignMessageProto2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*GroupField); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*UnknownToTestAllTypes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*NullHypothesisProto2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*EnumOnlyProto2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*OneStringProto2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*ProtoWithKeywords); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*TestAllRequiredTypesProto2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[29].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2_Data); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[30].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2_MultiWordGroupField); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[31].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2_MessageSetCorrect); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[32].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2_MessageSetCorrectExtension1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[33].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2_MessageSetCorrectExtension2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[34].Exporter = func(v any, i int) any { - switch v := v.(*UnknownToTestAllTypes_OptionalGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[35].Exporter = func(v any, i int) any { - switch v := v.(*TestAllRequiredTypesProto2_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[36].Exporter = func(v any, i int) any { - switch v := v.(*TestAllRequiredTypesProto2_Data); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[37].Exporter = func(v any, i int) any { - switch v := v.(*TestAllRequiredTypesProto2_MessageSetCorrect); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[38].Exporter = func(v any, i int) any { - switch v := v.(*TestAllRequiredTypesProto2_MessageSetCorrectExtension1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto2_proto_msgTypes[39].Exporter = func(v any, i int) any { - switch v := v.(*TestAllRequiredTypesProto2_MessageSetCorrectExtension2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_google_protobuf_test_messages_proto2_proto_msgTypes[0].OneofWrappers = []any{ (*TestAllTypesProto2_OneofUint32)(nil), (*TestAllTypesProto2_OneofNestedMessage)(nil), diff --git a/internal/testprotos/conformance/test_messages_proto3.pb.go b/internal/testprotos/conformance/test_messages_proto3.pb.go index 193771a8..ea2e8bab 100644 --- a/internal/testprotos/conformance/test_messages_proto3.pb.go +++ b/internal/testprotos/conformance/test_messages_proto3.pb.go @@ -2660,68 +2660,6 @@ func file_google_protobuf_test_messages_proto3_proto_init() { if File_google_protobuf_test_messages_proto3_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_test_messages_proto3_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto3); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto3_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ForeignMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto3_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*NullHypothesisProto3); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto3_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*EnumOnlyProto3); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_test_messages_proto3_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto3_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_google_protobuf_test_messages_proto3_proto_msgTypes[0].OneofWrappers = []any{ (*TestAllTypesProto3_OneofUint32)(nil), (*TestAllTypesProto3_OneofNestedMessage)(nil), diff --git a/internal/testprotos/editionsfuzztest/test2.pb.go b/internal/testprotos/editionsfuzztest/test2.pb.go index 8f43c58f..0cc07d6c 100644 --- a/internal/testprotos/editionsfuzztest/test2.pb.go +++ b/internal/testprotos/editionsfuzztest/test2.pb.go @@ -1631,68 +1631,6 @@ func file_internal_testprotos_editionsfuzztest_test2_proto_init() { if File_internal_testprotos_editionsfuzztest_test2_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_editionsfuzztest_test2_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_editionsfuzztest_test2_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_editionsfuzztest_test2_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2_OptionalGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_editionsfuzztest_test2_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2_RepeatedGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_editionsfuzztest_test2_proto_msgTypes[21].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2_OneofGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_internal_testprotos_editionsfuzztest_test2_proto_msgTypes[0].OneofWrappers = []any{ (*TestAllTypesProto2_OneofUint32)(nil), (*TestAllTypesProto2_OneofNestedMessage)(nil), diff --git a/internal/testprotos/editionsfuzztest/test2editions.pb.go b/internal/testprotos/editionsfuzztest/test2editions.pb.go index ea0979c0..24da583b 100644 --- a/internal/testprotos/editionsfuzztest/test2editions.pb.go +++ b/internal/testprotos/editionsfuzztest/test2editions.pb.go @@ -1655,68 +1655,6 @@ func file_internal_testprotos_editionsfuzztest_test2editions_proto_init() { if File_internal_testprotos_editionsfuzztest_test2editions_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_editionsfuzztest_test2editions_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2Editions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_editionsfuzztest_test2editions_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2Editions_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_editionsfuzztest_test2editions_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2Editions_OptionalGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_editionsfuzztest_test2editions_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2Editions_RepeatedGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_editionsfuzztest_test2editions_proto_msgTypes[21].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto2Editions_OneofGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_internal_testprotos_editionsfuzztest_test2editions_proto_msgTypes[0].OneofWrappers = []any{ (*TestAllTypesProto2Editions_OneofUint32)(nil), (*TestAllTypesProto2Editions_OneofNestedMessage)(nil), diff --git a/internal/testprotos/editionsfuzztest/test3.pb.go b/internal/testprotos/editionsfuzztest/test3.pb.go index 17296814..f8ef7941 100644 --- a/internal/testprotos/editionsfuzztest/test3.pb.go +++ b/internal/testprotos/editionsfuzztest/test3.pb.go @@ -1565,44 +1565,6 @@ func file_internal_testprotos_editionsfuzztest_test3_proto_init() { if File_internal_testprotos_editionsfuzztest_test3_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_editionsfuzztest_test3_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto3); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_editionsfuzztest_test3_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ForeignMessageProto3); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_editionsfuzztest_test3_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto3_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_internal_testprotos_editionsfuzztest_test3_proto_msgTypes[0].OneofWrappers = []any{ (*TestAllTypesProto3_OneofUint32)(nil), (*TestAllTypesProto3_OneofNestedMessage)(nil), diff --git a/internal/testprotos/editionsfuzztest/test3editions.pb.go b/internal/testprotos/editionsfuzztest/test3editions.pb.go index 7e23edbe..ee4f87a9 100644 --- a/internal/testprotos/editionsfuzztest/test3editions.pb.go +++ b/internal/testprotos/editionsfuzztest/test3editions.pb.go @@ -1563,44 +1563,6 @@ func file_internal_testprotos_editionsfuzztest_test3editions_proto_init() { if File_internal_testprotos_editionsfuzztest_test3editions_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_editionsfuzztest_test3editions_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto3Editions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_editionsfuzztest_test3editions_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ForeignMessageProto3Editions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_editionsfuzztest_test3editions_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypesProto3Editions_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_internal_testprotos_editionsfuzztest_test3editions_proto_msgTypes[0].OneofWrappers = []any{ (*TestAllTypesProto3Editions_OneofUint32)(nil), (*TestAllTypesProto3Editions_OneofNestedMessage)(nil), diff --git a/internal/testprotos/fieldtrack/fieldtrack.pb.go b/internal/testprotos/fieldtrack/fieldtrack.pb.go index b4f76bd1..b6dcbb9b 100644 --- a/internal/testprotos/fieldtrack/fieldtrack.pb.go +++ b/internal/testprotos/fieldtrack/fieldtrack.pb.go @@ -1005,22 +1005,6 @@ func file_internal_testprotos_fieldtrack_fieldtrack_proto_init() { if File_internal_testprotos_fieldtrack_fieldtrack_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_fieldtrack_fieldtrack_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*TestFieldTrack); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.weakFields - case 3: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/fuzz/fuzz.pb.go b/internal/testprotos/fuzz/fuzz.pb.go index d4505af8..41d7a9dc 100644 --- a/internal/testprotos/fuzz/fuzz.pb.go +++ b/internal/testprotos/fuzz/fuzz.pb.go @@ -226,20 +226,6 @@ func file_internal_testprotos_fuzz_fuzz_proto_init() { if File_internal_testprotos_fuzz_fuzz_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_fuzz_fuzz_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Fuzz); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/irregular/test.pb.go b/internal/testprotos/irregular/test.pb.go index a2bf282d..2b97f157 100644 --- a/internal/testprotos/irregular/test.pb.go +++ b/internal/testprotos/irregular/test.pb.go @@ -299,20 +299,6 @@ func file_internal_testprotos_irregular_test_proto_init() { return } file_internal_testprotos_irregular_irregular_proto_init() - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_irregular_test_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Message); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_internal_testprotos_irregular_test_proto_msgTypes[0].OneofWrappers = []any{ (*Message_OneofMessage)(nil), (*Message_OneofAberrantMessage)(nil), diff --git a/internal/testprotos/lazy/lazy_extension_normalized_wire_test.pb.go b/internal/testprotos/lazy/lazy_extension_normalized_wire_test.pb.go index 3567c378..7e944480 100644 --- a/internal/testprotos/lazy/lazy_extension_normalized_wire_test.pb.go +++ b/internal/testprotos/lazy/lazy_extension_normalized_wire_test.pb.go @@ -260,46 +260,6 @@ func file_internal_testprotos_lazy_lazy_extension_normalized_wire_test_proto_ini if File_internal_testprotos_lazy_lazy_extension_normalized_wire_test_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_lazy_lazy_extension_normalized_wire_test_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Sub); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_internal_testprotos_lazy_lazy_extension_normalized_wire_test_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Top); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_lazy_lazy_extension_normalized_wire_test_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*Ext); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/lazy/lazy_extension_test.pb.go b/internal/testprotos/lazy/lazy_extension_test.pb.go index 815e95fa..bea98f14 100644 --- a/internal/testprotos/lazy/lazy_extension_test.pb.go +++ b/internal/testprotos/lazy/lazy_extension_test.pb.go @@ -749,94 +749,6 @@ func file_internal_testprotos_lazy_lazy_extension_test_proto_init() { if File_internal_testprotos_lazy_lazy_extension_test_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_lazy_lazy_extension_test_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Holder); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_lazy_lazy_extension_test_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Rabbit); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_lazy_lazy_extension_test_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*FlyingFox); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_lazy_lazy_extension_test_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*Tree); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_internal_testprotos_lazy_lazy_extension_test_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*Pipistrelle); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_lazy_lazy_extension_test_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*Pipistrelles); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_lazy_lazy_extension_test_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*BatNest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/legacy/legacy.pb.go b/internal/testprotos/legacy/legacy.pb.go index 460fc3d9..ab874a88 100644 --- a/internal/testprotos/legacy/legacy.pb.go +++ b/internal/testprotos/legacy/legacy.pb.go @@ -321,20 +321,6 @@ func file_internal_testprotos_legacy_legacy_proto_init() { if File_internal_testprotos_legacy_legacy_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_legacy_legacy_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Legacy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/messageset/messagesetpb/message_set.pb.go b/internal/testprotos/messageset/messagesetpb/message_set.pb.go index 0adbb65d..a73be5a9 100644 --- a/internal/testprotos/messageset/messagesetpb/message_set.pb.go +++ b/internal/testprotos/messageset/messagesetpb/message_set.pb.go @@ -154,34 +154,6 @@ func file_internal_testprotos_messageset_messagesetpb_message_set_proto_init() { if File_internal_testprotos_messageset_messagesetpb_message_set_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_messageset_messagesetpb_message_set_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*MessageSet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_internal_testprotos_messageset_messagesetpb_message_set_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*MessageSetContainer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/messageset/msetextpb/msetextpb.pb.go b/internal/testprotos/messageset/msetextpb/msetextpb.pb.go index 11b368f4..16acec0d 100644 --- a/internal/testprotos/messageset/msetextpb/msetextpb.pb.go +++ b/internal/testprotos/messageset/msetextpb/msetextpb.pb.go @@ -353,56 +353,6 @@ func file_internal_testprotos_messageset_msetextpb_msetextpb_proto_init() { if File_internal_testprotos_messageset_msetextpb_msetextpb_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_messageset_msetextpb_msetextpb_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Ext1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_messageset_msetextpb_msetextpb_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Ext2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_messageset_msetextpb_msetextpb_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*ExtRequired); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_messageset_msetextpb_msetextpb_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*ExtLargeNumber); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/news/news.pb.go b/internal/testprotos/news/news.pb.go index 022b89a3..145c1c51 100644 --- a/internal/testprotos/news/news.pb.go +++ b/internal/testprotos/news/news.pb.go @@ -361,44 +361,6 @@ func file_internal_testprotos_news_news_proto_init() { if File_internal_testprotos_news_news_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_news_news_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Article); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_news_news_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*BinaryAttachment); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_news_news_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*KeyValueAttachment); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/order/order.pb.go b/internal/testprotos/order/order.pb.go index c3bb0130..8d7dbe62 100644 --- a/internal/testprotos/order/order.pb.go +++ b/internal/testprotos/order/order.pb.go @@ -209,22 +209,6 @@ func file_internal_testprotos_order_order_proto_init() { if File_internal_testprotos_order_order_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_order_order_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Message); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - } file_internal_testprotos_order_order_proto_msgTypes[0].OneofWrappers = []any{ (*Message_Field_10)(nil), } diff --git a/internal/testprotos/race/extender/test.pb.go b/internal/testprotos/race/extender/test.pb.go index 68253a58..895631a7 100644 --- a/internal/testprotos/race/extender/test.pb.go +++ b/internal/testprotos/race/extender/test.pb.go @@ -132,20 +132,6 @@ func file_internal_testprotos_race_extender_test_proto_init() { if File_internal_testprotos_race_extender_test_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_race_extender_test_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*OtherMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/race/message/test.pb.go b/internal/testprotos/race/message/test.pb.go index a7309239..14773a78 100644 --- a/internal/testprotos/race/message/test.pb.go +++ b/internal/testprotos/race/message/test.pb.go @@ -108,22 +108,6 @@ func file_internal_testprotos_race_message_test_proto_init() { if File_internal_testprotos_race_message_test_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_race_message_test_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*MyMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/registry/test.pb.go b/internal/testprotos/registry/test.pb.go index d39ae18b..74e50833 100644 --- a/internal/testprotos/registry/test.pb.go +++ b/internal/testprotos/registry/test.pb.go @@ -498,58 +498,6 @@ func file_internal_testprotos_registry_test_proto_init() { if File_internal_testprotos_registry_test_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_registry_test_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Message1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_internal_testprotos_registry_test_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Message2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_registry_test_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*Message3); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_registry_test_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*Message4); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/required/required.pb.go b/internal/testprotos/required/required.pb.go index 553e4cae..236a055a 100644 --- a/internal/testprotos/required/required.pb.go +++ b/internal/testprotos/required/required.pb.go @@ -894,212 +894,6 @@ func file_internal_testprotos_required_required_proto_init() { if File_internal_testprotos_required_required_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_required_required_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Int32); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_required_required_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Int64); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_required_required_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*Uint32); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_required_required_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*Uint64); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_required_required_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*Sint32); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_required_required_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*Sint64); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_required_required_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*Fixed32); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_required_required_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*Fixed64); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_required_required_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*Float); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_required_required_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*Double); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_required_required_proto_msgTypes[10].Exporter = func(v any, i int) any { - switch v := v.(*Bool); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_required_required_proto_msgTypes[11].Exporter = func(v any, i int) any { - switch v := v.(*String); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_required_required_proto_msgTypes[12].Exporter = func(v any, i int) any { - switch v := v.(*Bytes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_required_required_proto_msgTypes[13].Exporter = func(v any, i int) any { - switch v := v.(*Message); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_required_required_proto_msgTypes[14].Exporter = func(v any, i int) any { - switch v := v.(*Group); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_required_required_proto_msgTypes[15].Exporter = func(v any, i int) any { - switch v := v.(*Message_M); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_required_required_proto_msgTypes[16].Exporter = func(v any, i int) any { - switch v := v.(*Group_Group); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/test/test.pb.go b/internal/testprotos/test/test.pb.go index 1da5ff1f..d51e71f7 100644 --- a/internal/testprotos/test/test.pb.go +++ b/internal/testprotos/test/test.pb.go @@ -5037,340 +5037,6 @@ func file_internal_testprotos_test_test_proto_init() { } file_internal_testprotos_test_test_public_proto_init() file_internal_testprotos_test_test_import_proto_init() - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_test_test_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*TestDeprecatedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*ForeignMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*TestReservedFields); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*TestAllExtensions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*OptionalGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*RepeatedGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*TestNestedExtension); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*TestRequired); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*TestRequiredForeign); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[10].Exporter = func(v any, i int) any { - switch v := v.(*TestRequiredGroupFields); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[11].Exporter = func(v any, i int) any { - switch v := v.(*TestWeak); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.weakFields - case 3: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[12].Exporter = func(v any, i int) any { - switch v := v.(*TestPackedTypes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[13].Exporter = func(v any, i int) any { - switch v := v.(*TestUnpackedTypes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[14].Exporter = func(v any, i int) any { - switch v := v.(*TestPackedExtensions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[15].Exporter = func(v any, i int) any { - switch v := v.(*TestUnpackedExtensions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[16].Exporter = func(v any, i int) any { - switch v := v.(*FooRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[17].Exporter = func(v any, i int) any { - switch v := v.(*FooResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[18].Exporter = func(v any, i int) any { - switch v := v.(*WeirdDefault); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[19].Exporter = func(v any, i int) any { - switch v := v.(*RemoteDefault); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[20].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypes_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[21].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypes_OptionalGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[22].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypes_RepeatedGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[40].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypes_OneofGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[41].Exporter = func(v any, i int) any { - switch v := v.(*TestAllExtensions_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[43].Exporter = func(v any, i int) any { - switch v := v.(*TestRequiredGroupFields_OptionalGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test_test_proto_msgTypes[44].Exporter = func(v any, i int) any { - switch v := v.(*TestRequiredGroupFields_RepeatedGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_internal_testprotos_test_test_proto_msgTypes[0].OneofWrappers = []any{ (*TestAllTypes_OneofUint32)(nil), (*TestAllTypes_OneofNestedMessage)(nil), diff --git a/internal/testprotos/test/test_import.pb.go b/internal/testprotos/test/test_import.pb.go index cd05c33a..2c34c351 100644 --- a/internal/testprotos/test/test_import.pb.go +++ b/internal/testprotos/test/test_import.pb.go @@ -152,20 +152,6 @@ func file_internal_testprotos_test_test_import_proto_init() { if File_internal_testprotos_test_test_import_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_test_test_import_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*ImportMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/test/test_public.pb.go b/internal/testprotos/test/test_public.pb.go index 70e2247d..b39cc80c 100644 --- a/internal/testprotos/test/test_public.pb.go +++ b/internal/testprotos/test/test_public.pb.go @@ -95,20 +95,6 @@ func file_internal_testprotos_test_test_public_proto_init() { if File_internal_testprotos_test_test_public_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_test_test_public_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*PublicImportMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/test/weak1/test_weak.pb.go b/internal/testprotos/test/weak1/test_weak.pb.go index c1030c2d..fa72ec9a 100644 --- a/internal/testprotos/test/weak1/test_weak.pb.go +++ b/internal/testprotos/test/weak1/test_weak.pb.go @@ -106,20 +106,6 @@ func file_internal_testprotos_test_weak1_test_weak_proto_init() { if File_internal_testprotos_test_weak1_test_weak_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_test_weak1_test_weak_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*WeakImportMessage1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/test/weak2/test_weak.pb.go b/internal/testprotos/test/weak2/test_weak.pb.go index dcf0c68b..732d3d24 100644 --- a/internal/testprotos/test/weak2/test_weak.pb.go +++ b/internal/testprotos/test/weak2/test_weak.pb.go @@ -106,20 +106,6 @@ func file_internal_testprotos_test_weak2_test_weak_proto_init() { if File_internal_testprotos_test_weak2_test_weak_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_test_weak2_test_weak_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*WeakImportMessage2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/test3/test.pb.go b/internal/testprotos/test3/test.pb.go index acae4661..a1b5dc1e 100644 --- a/internal/testprotos/test3/test.pb.go +++ b/internal/testprotos/test3/test.pb.go @@ -1646,44 +1646,6 @@ func file_internal_testprotos_test3_test_proto_init() { return } file_internal_testprotos_test3_test_import_proto_init() - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_test3_test_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test3_test_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ForeignMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_test3_test_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypes_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_internal_testprotos_test3_test_proto_msgTypes[0].OneofWrappers = []any{ (*TestAllTypes_OneofUint32)(nil), (*TestAllTypes_OneofNestedMessage)(nil), diff --git a/internal/testprotos/test3/test_import.pb.go b/internal/testprotos/test3/test_import.pb.go index d11af879..129731d4 100644 --- a/internal/testprotos/test3/test_import.pb.go +++ b/internal/testprotos/test3/test_import.pb.go @@ -143,20 +143,6 @@ func file_internal_testprotos_test3_test_import_proto_init() { if File_internal_testprotos_test3_test_import_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_test3_test_import_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*ImportMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/testeditions/test.pb.go b/internal/testprotos/testeditions/test.pb.go index bce0bb8d..aea3f0d8 100644 --- a/internal/testprotos/testeditions/test.pb.go +++ b/internal/testprotos/testeditions/test.pb.go @@ -2842,166 +2842,6 @@ func file_internal_testprotos_testeditions_test_proto_init() { if File_internal_testprotos_testeditions_test_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_testeditions_test_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ForeignMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*TestRequired); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*TestRequiredForeign); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*TestRequiredGroupFields); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*TestPackedTypes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*TestPackedExtensions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypes_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypes_OptionalGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypes_RepeatedGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_proto_msgTypes[27].Exporter = func(v any, i int) any { - switch v := v.(*TestAllTypes_OneofGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_proto_msgTypes[29].Exporter = func(v any, i int) any { - switch v := v.(*TestRequiredGroupFields_OptionalGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_proto_msgTypes[30].Exporter = func(v any, i int) any { - switch v := v.(*TestRequiredGroupFields_RepeatedGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_internal_testprotos_testeditions_test_proto_msgTypes[0].OneofWrappers = []any{ (*TestAllTypes_OneofUint32)(nil), (*TestAllTypes_OneofNestedMessage)(nil), diff --git a/internal/testprotos/testeditions/test_extension.pb.go b/internal/testprotos/testeditions/test_extension.pb.go index 5adc5d4e..f7836648 100644 --- a/internal/testprotos/testeditions/test_extension.pb.go +++ b/internal/testprotos/testeditions/test_extension.pb.go @@ -1394,84 +1394,6 @@ func file_internal_testprotos_testeditions_test_extension_proto_init() { return } file_internal_testprotos_testeditions_test_proto_init() - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_testeditions_test_extension_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*TestAllExtensions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_extension_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*OptionalGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_extension_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*RepeatedGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_extension_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*TestFeatureResolution); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_extension_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*RepeatedFieldEncoding); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_testeditions_test_extension_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*TestAllExtensions_NestedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/testeditions/test_extension2.pb.go b/internal/testprotos/testeditions/test_extension2.pb.go index 3bce501e..4656e537 100644 --- a/internal/testprotos/testeditions/test_extension2.pb.go +++ b/internal/testprotos/testeditions/test_extension2.pb.go @@ -191,20 +191,6 @@ func file_internal_testprotos_testeditions_test_extension2_proto_init() { return } file_internal_testprotos_testeditions_test_extension_proto_init() - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_testeditions_test_extension2_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*OtherRepeatedFieldEncoding); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/testprotos/textpb2/test.pb.go b/internal/testprotos/textpb2/test.pb.go index cbc85f50..83dc4206 100644 --- a/internal/testprotos/textpb2/test.pb.go +++ b/internal/testprotos/textpb2/test.pb.go @@ -2302,254 +2302,6 @@ func file_internal_testprotos_textpb2_test_proto_init() { if File_internal_testprotos_textpb2_test_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_textpb2_test_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Scalars); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Enums); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*Repeats); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*Maps); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*Nested); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*Nests); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*Requireds); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*PartialRequired); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*NestedWithRequired); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*IndirectRequired); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[10].Exporter = func(v any, i int) any { - switch v := v.(*Extensions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[11].Exporter = func(v any, i int) any { - switch v := v.(*ExtensionsContainer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[12].Exporter = func(v any, i int) any { - switch v := v.(*MessageSet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[13].Exporter = func(v any, i int) any { - switch v := v.(*MessageSetExtension); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[14].Exporter = func(v any, i int) any { - switch v := v.(*FakeMessageSet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[15].Exporter = func(v any, i int) any { - switch v := v.(*FakeMessageSetExtension); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[16].Exporter = func(v any, i int) any { - switch v := v.(*KnownTypes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[19].Exporter = func(v any, i int) any { - switch v := v.(*Nests_OptGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[20].Exporter = func(v any, i int) any { - switch v := v.(*Nests_RptGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb2_test_proto_msgTypes[21].Exporter = func(v any, i int) any { - switch v := v.(*Nests_OptGroup_OptNestedGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_internal_testprotos_textpb2_test_proto_msgTypes[9].OneofWrappers = []any{ (*IndirectRequired_OneofNested)(nil), } diff --git a/internal/testprotos/textpb3/test.pb.go b/internal/testprotos/textpb3/test.pb.go index d595274e..f9f4d4cf 100644 --- a/internal/testprotos/textpb3/test.pb.go +++ b/internal/testprotos/textpb3/test.pb.go @@ -1132,116 +1132,6 @@ func file_internal_testprotos_textpb3_test_proto_init() { if File_internal_testprotos_textpb3_test_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_textpb3_test_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Scalars); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb3_test_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Repeats); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb3_test_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*Proto3Optional); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb3_test_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*Enums); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb3_test_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*Nests); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb3_test_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*Nested); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb3_test_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*Oneofs); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb3_test_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*Maps); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpb3_test_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*JSONNames); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_internal_testprotos_textpb3_test_proto_msgTypes[2].OneofWrappers = []any{} file_internal_testprotos_textpb3_test_proto_msgTypes[6].OneofWrappers = []any{ (*Oneofs_OneofEnum)(nil), diff --git a/internal/testprotos/textpbeditions/test2.pb.go b/internal/testprotos/textpbeditions/test2.pb.go index f1a4697b..ae22c7f9 100644 --- a/internal/testprotos/textpbeditions/test2.pb.go +++ b/internal/testprotos/textpbeditions/test2.pb.go @@ -2787,290 +2787,6 @@ func file_internal_testprotos_textpbeditions_test2_proto_init() { if File_internal_testprotos_textpbeditions_test2_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Scalars); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ImplicitScalars); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*UTF8Validated); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*NestsUTF8Validated); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*Enums); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*Repeats); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*Maps); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*Nested); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*Nests); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*Requireds); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[10].Exporter = func(v any, i int) any { - switch v := v.(*PartialRequired); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[11].Exporter = func(v any, i int) any { - switch v := v.(*NestedWithRequired); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[12].Exporter = func(v any, i int) any { - switch v := v.(*IndirectRequired); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[13].Exporter = func(v any, i int) any { - switch v := v.(*Extensions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[14].Exporter = func(v any, i int) any { - switch v := v.(*ExtensionsContainer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[15].Exporter = func(v any, i int) any { - switch v := v.(*MessageSet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[16].Exporter = func(v any, i int) any { - switch v := v.(*MessageSetExtension); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[17].Exporter = func(v any, i int) any { - switch v := v.(*FakeMessageSet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[18].Exporter = func(v any, i int) any { - switch v := v.(*FakeMessageSetExtension); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[19].Exporter = func(v any, i int) any { - switch v := v.(*KnownTypes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[22].Exporter = func(v any, i int) any { - switch v := v.(*Nests_OptGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[23].Exporter = func(v any, i int) any { - switch v := v.(*Nests_RptGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_testprotos_textpbeditions_test2_proto_msgTypes[24].Exporter = func(v any, i int) any { - switch v := v.(*Nests_OptGroup_OptNestedGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_internal_testprotos_textpbeditions_test2_proto_msgTypes[12].OneofWrappers = []any{ (*IndirectRequired_OneofNested)(nil), } diff --git a/reflect/protoreflect/value_pure.go b/reflect/protoreflect/value_pure.go deleted file mode 100644 index 75f83a2a..00000000 --- a/reflect/protoreflect/value_pure.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build purego || appengine -// +build purego appengine - -package protoreflect - -import "google.golang.org/protobuf/internal/pragma" - -type valueType int - -const ( - nilType valueType = iota - boolType - int32Type - int64Type - uint32Type - uint64Type - float32Type - float64Type - stringType - bytesType - enumType - ifaceType -) - -// value is a union where only one type can be represented at a time. -// This uses a distinct field for each type. This is type safe in Go, but -// occupies more memory than necessary (72B). -type value struct { - pragma.DoNotCompare // 0B - - typ valueType // 8B - num uint64 // 8B - str string // 16B - bin []byte // 24B - iface any // 16B -} - -func valueOfString(v string) Value { - return Value{typ: stringType, str: v} -} -func valueOfBytes(v []byte) Value { - return Value{typ: bytesType, bin: v} -} -func valueOfIface(v any) Value { - return Value{typ: ifaceType, iface: v} -} - -func (v Value) getString() string { - return v.str -} -func (v Value) getBytes() []byte { - return v.bin -} -func (v Value) getIface() any { - return v.iface -} diff --git a/reflect/protoreflect/value_unsafe_go120.go b/reflect/protoreflect/value_unsafe_go120.go index 7f3583ea..0015fcb3 100644 --- a/reflect/protoreflect/value_unsafe_go120.go +++ b/reflect/protoreflect/value_unsafe_go120.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !purego && !appengine && !go1.21 -// +build !purego,!appengine,!go1.21 +//go:build !go1.21 package protoreflect diff --git a/reflect/protoreflect/value_unsafe_go121.go b/reflect/protoreflect/value_unsafe_go121.go index f7d38699..479527b5 100644 --- a/reflect/protoreflect/value_unsafe_go121.go +++ b/reflect/protoreflect/value_unsafe_go121.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !purego && !appengine && go1.21 -// +build !purego,!appengine,go1.21 +//go:build go1.21 package protoreflect diff --git a/types/descriptorpb/descriptor.pb.go b/types/descriptorpb/descriptor.pb.go index 9403eb07..12590ad7 100644 --- a/types/descriptorpb/descriptor.pb.go +++ b/types/descriptorpb/descriptor.pb.go @@ -5385,424 +5385,6 @@ func file_google_protobuf_descriptor_proto_init() { if File_google_protobuf_descriptor_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_descriptor_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*FileDescriptorSet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*FileDescriptorProto); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*DescriptorProto); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*ExtensionRangeOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*FieldDescriptorProto); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*OneofDescriptorProto); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*EnumDescriptorProto); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*EnumValueDescriptorProto); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*ServiceDescriptorProto); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*MethodDescriptorProto); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[10].Exporter = func(v any, i int) any { - switch v := v.(*FileOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[11].Exporter = func(v any, i int) any { - switch v := v.(*MessageOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[12].Exporter = func(v any, i int) any { - switch v := v.(*FieldOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[13].Exporter = func(v any, i int) any { - switch v := v.(*OneofOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[14].Exporter = func(v any, i int) any { - switch v := v.(*EnumOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[15].Exporter = func(v any, i int) any { - switch v := v.(*EnumValueOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[16].Exporter = func(v any, i int) any { - switch v := v.(*ServiceOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[17].Exporter = func(v any, i int) any { - switch v := v.(*MethodOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[18].Exporter = func(v any, i int) any { - switch v := v.(*UninterpretedOption); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[19].Exporter = func(v any, i int) any { - switch v := v.(*FeatureSet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - case 3: - return &v.extensionFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[20].Exporter = func(v any, i int) any { - switch v := v.(*FeatureSetDefaults); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[21].Exporter = func(v any, i int) any { - switch v := v.(*SourceCodeInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[22].Exporter = func(v any, i int) any { - switch v := v.(*GeneratedCodeInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[23].Exporter = func(v any, i int) any { - switch v := v.(*DescriptorProto_ExtensionRange); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[24].Exporter = func(v any, i int) any { - switch v := v.(*DescriptorProto_ReservedRange); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[25].Exporter = func(v any, i int) any { - switch v := v.(*ExtensionRangeOptions_Declaration); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[26].Exporter = func(v any, i int) any { - switch v := v.(*EnumDescriptorProto_EnumReservedRange); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[27].Exporter = func(v any, i int) any { - switch v := v.(*FieldOptions_EditionDefault); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[28].Exporter = func(v any, i int) any { - switch v := v.(*FieldOptions_FeatureSupport); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[29].Exporter = func(v any, i int) any { - switch v := v.(*UninterpretedOption_NamePart); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[30].Exporter = func(v any, i int) any { - switch v := v.(*FeatureSetDefaults_FeatureSetEditionDefault); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[31].Exporter = func(v any, i int) any { - switch v := v.(*SourceCodeInfo_Location); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_descriptor_proto_msgTypes[32].Exporter = func(v any, i int) any { - switch v := v.(*GeneratedCodeInfo_Annotation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/types/gofeaturespb/go_features.pb.go b/types/gofeaturespb/go_features.pb.go index a2ca940c..18eb1e3c 100644 --- a/types/gofeaturespb/go_features.pb.go +++ b/types/gofeaturespb/go_features.pb.go @@ -145,20 +145,6 @@ func file_google_protobuf_go_features_proto_init() { if File_google_protobuf_go_features_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_go_features_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*GoFeatures); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/types/known/anypb/any.pb.go b/types/known/anypb/any.pb.go index 7172b43d..1b5f576e 100644 --- a/types/known/anypb/any.pb.go +++ b/types/known/anypb/any.pb.go @@ -461,20 +461,6 @@ func file_google_protobuf_any_proto_init() { if File_google_protobuf_any_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_any_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Any); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/types/known/apipb/api.pb.go b/types/known/apipb/api.pb.go index 4f2fe89e..3512d3dc 100644 --- a/types/known/apipb/api.pb.go +++ b/types/known/apipb/api.pb.go @@ -516,44 +516,6 @@ func file_google_protobuf_api_proto_init() { if File_google_protobuf_api_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_api_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Api); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_api_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Method); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_api_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*Mixin); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/types/known/durationpb/duration.pb.go b/types/known/durationpb/duration.pb.go index 1b71bcd9..aef4a8ca 100644 --- a/types/known/durationpb/duration.pb.go +++ b/types/known/durationpb/duration.pb.go @@ -339,20 +339,6 @@ func file_google_protobuf_duration_proto_init() { if File_google_protobuf_duration_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_duration_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Duration); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/types/known/emptypb/empty.pb.go b/types/known/emptypb/empty.pb.go index d87b4fb8..b6806b50 100644 --- a/types/known/emptypb/empty.pb.go +++ b/types/known/emptypb/empty.pb.go @@ -131,20 +131,6 @@ func file_google_protobuf_empty_proto_init() { if File_google_protobuf_empty_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_empty_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Empty); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/types/known/fieldmaskpb/field_mask.pb.go b/types/known/fieldmaskpb/field_mask.pb.go index ac1e91bb..ae59fd93 100644 --- a/types/known/fieldmaskpb/field_mask.pb.go +++ b/types/known/fieldmaskpb/field_mask.pb.go @@ -553,20 +553,6 @@ func file_google_protobuf_field_mask_proto_init() { if File_google_protobuf_field_mask_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_field_mask_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*FieldMask); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/types/known/sourcecontextpb/source_context.pb.go b/types/known/sourcecontextpb/source_context.pb.go index fa185780..f8d07959 100644 --- a/types/known/sourcecontextpb/source_context.pb.go +++ b/types/known/sourcecontextpb/source_context.pb.go @@ -141,20 +141,6 @@ func file_google_protobuf_source_context_proto_init() { if File_google_protobuf_source_context_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_source_context_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*SourceContext); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/types/known/structpb/struct.pb.go b/types/known/structpb/struct.pb.go index 71986d72..99014897 100644 --- a/types/known/structpb/struct.pb.go +++ b/types/known/structpb/struct.pb.go @@ -758,44 +758,6 @@ func file_google_protobuf_struct_proto_init() { if File_google_protobuf_struct_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_struct_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Struct); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_struct_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Value); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_struct_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*ListValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_google_protobuf_struct_proto_msgTypes[1].OneofWrappers = []any{ (*Value_NullValue)(nil), (*Value_NumberValue)(nil), diff --git a/types/known/timestamppb/timestamp.pb.go b/types/known/timestamppb/timestamp.pb.go index 83a5a645..5542bfbc 100644 --- a/types/known/timestamppb/timestamp.pb.go +++ b/types/known/timestamppb/timestamp.pb.go @@ -348,20 +348,6 @@ func file_google_protobuf_timestamp_proto_init() { if File_google_protobuf_timestamp_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_timestamp_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Timestamp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/types/known/typepb/type.pb.go b/types/known/typepb/type.pb.go index 52887fd5..3bae326c 100644 --- a/types/known/typepb/type.pb.go +++ b/types/known/typepb/type.pb.go @@ -906,68 +906,6 @@ func file_google_protobuf_type_proto_init() { if File_google_protobuf_type_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_type_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Type); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_type_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Field); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_type_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*Enum); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_type_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*EnumValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_type_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*Option); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/types/known/wrapperspb/wrappers.pb.go b/types/known/wrapperspb/wrappers.pb.go index e473f826..7563b39d 100644 --- a/types/known/wrapperspb/wrappers.pb.go +++ b/types/known/wrapperspb/wrappers.pb.go @@ -629,116 +629,6 @@ func file_google_protobuf_wrappers_proto_init() { if File_google_protobuf_wrappers_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_wrappers_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*DoubleValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_wrappers_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*FloatValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_wrappers_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*Int64Value); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_wrappers_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*UInt64Value); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_wrappers_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*Int32Value); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_wrappers_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*UInt32Value); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_wrappers_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*BoolValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_wrappers_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*StringValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_wrappers_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*BytesValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/types/pluginpb/plugin.pb.go b/types/pluginpb/plugin.pb.go index 9066bcc7..613bf143 100644 --- a/types/pluginpb/plugin.pb.go +++ b/types/pluginpb/plugin.pb.go @@ -618,56 +618,6 @@ func file_google_protobuf_compiler_plugin_proto_init() { if File_google_protobuf_compiler_plugin_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_compiler_plugin_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Version); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_compiler_plugin_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*CodeGeneratorRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_compiler_plugin_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*CodeGeneratorResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_google_protobuf_compiler_plugin_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*CodeGeneratorResponse_File); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{