From 7ea76d2a4c800487ec2a583f747736826277ff9e Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Wed, 19 Jun 2019 22:45:47 -0700 Subject: [PATCH] cmd/protoc-gen-go: un-deprecate enum maps If we were starting from scratch, we would not have added the enum maps. However, they already exist and see a fair amount of usage. The effort to remove them is not worth it. Thus, remove the deprecation warning since they are here to stay. Note that the generated code does not refer to the generated enum maps. One day, the linker should be able to elide them if unused by the user. However, https://golang.org/issue/2559 would need to be resolved first. Change-Id: Ia8b9b1812b5d8462ca2fa1d543170e4a09ff9e4f Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/183177 Reviewed-by: Damien Neil --- cmd/protoc-gen-go/internal_gengo/main.go | 2 -- .../testdata/annotations/annotations.pb.go | 2 -- .../testdata/annotations/annotations.pb.go.meta | 2 +- cmd/protoc-gen-go/testdata/comments/deprecated.pb.go | 2 -- cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go | 2 -- .../testdata/extensions/proto3/ext3.pb.go | 2 -- cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go | 6 ------ cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go | 2 -- cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go | 2 -- cmd/protoc-gen-go/testdata/proto2/enum.pb.go | 12 ------------ cmd/protoc-gen-go/testdata/proto2/fields.pb.go | 2 -- cmd/protoc-gen-go/testdata/proto3/enum.pb.go | 2 -- cmd/protoc-gen-go/testdata/proto3/fields.pb.go | 2 -- encoding/testprotos/pb2/test.pb.go | 4 ---- encoding/testprotos/pb3/test.pb.go | 4 ---- internal/testprotos/conformance/conformance.pb.go | 4 ---- .../conformance/test_messages_proto2.pb.go | 4 ---- .../conformance/test_messages_proto3.pb.go | 6 ------ internal/testprotos/test/test.pb.go | 8 -------- internal/testprotos/test/test_import.pb.go | 2 -- internal/testprotos/test3/test.pb.go | 4 ---- internal/testprotos/test3/test_import.pb.go | 2 -- reflect/protoregistry/testprotos/test.pb.go | 6 ------ types/descriptorpb/descriptor.pb.go | 12 ------------ types/known/structpb/struct.pb.go | 2 -- types/known/typepb/type.pb.go | 6 ------ 26 files changed, 1 insertion(+), 103 deletions(-) diff --git a/cmd/protoc-gen-go/internal_gengo/main.go b/cmd/protoc-gen-go/internal_gengo/main.go index b3556a4c..9f77d591 100644 --- a/cmd/protoc-gen-go/internal_gengo/main.go +++ b/cmd/protoc-gen-go/internal_gengo/main.go @@ -240,7 +240,6 @@ func genEnum(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, enum // Enum value mapping (number -> name). if generateEnumMapVars { nameMap := enum.GoIdent.GoName + "_name" - g.P("// Deprecated: Use ", enum.GoIdent.GoName, ".Type.Values instead.") g.P("var ", nameMap, " = map[int32]string{") generated := make(map[protoreflect.EnumNumber]bool) for _, value := range enum.Values { @@ -258,7 +257,6 @@ func genEnum(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileInfo, enum // Enum value mapping (name -> number). if generateEnumMapVars { valueMap := enum.GoIdent.GoName + "_value" - g.P("// Deprecated: Use ", enum.GoIdent.GoName, ".Type.Values instead.") g.P("var ", valueMap, " = map[string]int32{") for _, value := range enum.Values { g.P(strconv.Quote(string(value.Desc.Name())), ": ", value.Desc.Number(), ",") diff --git a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go index e81a04f5..a99dbb18 100644 --- a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go +++ b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go @@ -24,12 +24,10 @@ const ( AnnotationsTestEnum_ANNOTATIONS_TEST_ENUM_VALUE AnnotationsTestEnum = 0 ) -// Deprecated: Use AnnotationsTestEnum.Type.Values instead. var AnnotationsTestEnum_name = map[int32]string{ 0: "ANNOTATIONS_TEST_ENUM_VALUE", } -// Deprecated: Use AnnotationsTestEnum.Type.Values instead. var AnnotationsTestEnum_value = map[string]int32{ "ANNOTATIONS_TEST_ENUM_VALUE": 0, } diff --git a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta index a70d9895..e127af07 100644 --- a/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta +++ b/cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta @@ -1 +1 @@ -annotation:{path:5 path:0 source_file:"annotations/annotations.proto" begin:631 end:650} annotation:{path:5 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:667 end:714} annotation:{path:4 path:0 source_file:"annotations/annotations.proto" begin:1941 end:1963} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:1974 end:1994} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:3015 end:3038} \ No newline at end of file +annotation:{path:5 path:0 source_file:"annotations/annotations.proto" begin:631 end:650} annotation:{path:5 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:667 end:714} annotation:{path:4 path:0 source_file:"annotations/annotations.proto" begin:1821 end:1843} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:1854 end:1874} annotation:{path:4 path:0 path:2 path:0 source_file:"annotations/annotations.proto" begin:2895 end:2918} \ No newline at end of file diff --git a/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go b/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go index 22db1189..beeeded6 100644 --- a/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go +++ b/cmd/protoc-gen-go/testdata/comments/deprecated.pb.go @@ -23,12 +23,10 @@ const ( DeprecatedEnum_DEPRECATED DeprecatedEnum = 0 // Deprecated: Do not use. ) -// Deprecated: Use DeprecatedEnum.Type.Values instead. var DeprecatedEnum_name = map[int32]string{ 0: "DEPRECATED", } -// Deprecated: Use DeprecatedEnum.Type.Values instead. var DeprecatedEnum_value = map[string]int32{ "DEPRECATED": 0, } 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 167390f3..451a0b6d 100644 --- a/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go +++ b/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go @@ -26,12 +26,10 @@ const ( Enum_ZERO Enum = 0 ) -// Deprecated: Use Enum.Type.Values instead. var Enum_name = map[int32]string{ 0: "ZERO", } -// Deprecated: Use Enum.Type.Values instead. var Enum_value = map[string]int32{ "ZERO": 0, } diff --git a/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go b/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go index c88a642d..74b844e4 100644 --- a/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go +++ b/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go @@ -25,12 +25,10 @@ const ( Enum_ZERO Enum = 0 ) -// Deprecated: Use Enum.Type.Values instead. var Enum_name = map[int32]string{ 0: "ZERO", } -// Deprecated: Use Enum.Type.Values instead. var Enum_value = map[string]int32{ "ZERO": 0, } diff --git a/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go b/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go index fc5a845a..2b7b0810 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 @@ -30,12 +30,10 @@ const ( E_ZERO E = 0 ) -// Deprecated: Use E.Type.Values instead. var E_name = map[int32]string{ 0: "ZERO", } -// Deprecated: Use E.Type.Values instead. var E_value = map[string]int32{ "ZERO": 0, } @@ -79,12 +77,10 @@ const ( M_M_ZERO M_Subenum = 0 ) -// Deprecated: Use M_Subenum.Type.Values instead. var M_Subenum_name = map[int32]string{ 0: "M_ZERO", } -// Deprecated: Use M_Subenum.Type.Values instead. var M_Subenum_value = map[string]int32{ "M_ZERO": 0, } @@ -128,12 +124,10 @@ const ( M_Submessage_M_SUBMESSAGE_ZERO M_Submessage_Submessage_Subenum = 0 ) -// Deprecated: Use M_Submessage_Submessage_Subenum.Type.Values instead. var M_Submessage_Submessage_Subenum_name = map[int32]string{ 0: "M_SUBMESSAGE_ZERO", } -// Deprecated: Use M_Submessage_Submessage_Subenum.Type.Values instead. var M_Submessage_Submessage_Subenum_value = map[string]int32{ "M_SUBMESSAGE_ZERO": 0, } diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go b/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go index 1106dc65..915316f0 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 @@ -24,12 +24,10 @@ const ( E1_E1_ZERO E1 = 0 ) -// Deprecated: Use E1.Type.Values instead. var E1_name = map[int32]string{ 0: "E1_ZERO", } -// Deprecated: Use E1.Type.Values instead. var E1_value = map[string]int32{ "E1_ZERO": 0, } diff --git a/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go b/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go index 15c743f5..3854d2b2 100644 --- a/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go +++ b/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go @@ -24,12 +24,10 @@ const ( Enum_ZERO Enum = 0 ) -// Deprecated: Use Enum.Type.Values instead. var Enum_name = map[int32]string{ 0: "ZERO", } -// Deprecated: Use Enum.Type.Values instead. var Enum_value = map[string]int32{ "ZERO": 0, } diff --git a/cmd/protoc-gen-go/testdata/proto2/enum.pb.go b/cmd/protoc-gen-go/testdata/proto2/enum.pb.go index b741f56e..0b27fc3d 100644 --- a/cmd/protoc-gen-go/testdata/proto2/enum.pb.go +++ b/cmd/protoc-gen-go/testdata/proto2/enum.pb.go @@ -28,13 +28,11 @@ const ( EnumType1_TWO EnumType1 = 2 ) -// Deprecated: Use EnumType1.Type.Values instead. var EnumType1_name = map[int32]string{ 1: "ONE", 2: "TWO", } -// Deprecated: Use EnumType1.Type.Values instead. var EnumType1_value = map[string]int32{ "ONE": 1, "TWO": 2, @@ -80,13 +78,11 @@ const ( EnumType2_duplicate2 EnumType2 = 1 ) -// Deprecated: Use EnumType2.Type.Values instead. var EnumType2_name = map[int32]string{ 1: "duplicate1", // Duplicate value: 1: "duplicate2", } -// Deprecated: Use EnumType2.Type.Values instead. var EnumType2_value = map[string]int32{ "duplicate1": 1, "duplicate2": 1, @@ -133,12 +129,10 @@ const ( EnumContainerMessage1_NESTED_1A_VALUE EnumContainerMessage1_NestedEnumType1A = 0 ) -// Deprecated: Use EnumContainerMessage1_NestedEnumType1A.Type.Values instead. var EnumContainerMessage1_NestedEnumType1A_name = map[int32]string{ 0: "NESTED_1A_VALUE", } -// Deprecated: Use EnumContainerMessage1_NestedEnumType1A.Type.Values instead. var EnumContainerMessage1_NestedEnumType1A_value = map[string]int32{ "NESTED_1A_VALUE": 0, } @@ -182,12 +176,10 @@ const ( EnumContainerMessage1_NESTED_1B_VALUE EnumContainerMessage1_NestedEnumType1B = 0 ) -// Deprecated: Use EnumContainerMessage1_NestedEnumType1B.Type.Values instead. var EnumContainerMessage1_NestedEnumType1B_name = map[int32]string{ 0: "NESTED_1B_VALUE", } -// Deprecated: Use EnumContainerMessage1_NestedEnumType1B.Type.Values instead. var EnumContainerMessage1_NestedEnumType1B_value = map[string]int32{ "NESTED_1B_VALUE": 0, } @@ -233,12 +225,10 @@ const ( EnumContainerMessage1_EnumContainerMessage2_NESTED_2A_VALUE EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A = 0 ) -// Deprecated: Use EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A.Type.Values instead. var EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_name = map[int32]string{ 0: "NESTED_2A_VALUE", } -// Deprecated: Use EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A.Type.Values instead. var EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_value = map[string]int32{ "NESTED_2A_VALUE": 0, } @@ -282,12 +272,10 @@ const ( EnumContainerMessage1_EnumContainerMessage2_NESTED_2B_VALUE EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B = 0 ) -// Deprecated: Use EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B.Type.Values instead. var EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_name = map[int32]string{ 0: "NESTED_2B_VALUE", } -// Deprecated: Use EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B.Type.Values instead. var EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_value = map[string]int32{ "NESTED_2B_VALUE": 0, } diff --git a/cmd/protoc-gen-go/testdata/proto2/fields.pb.go b/cmd/protoc-gen-go/testdata/proto2/fields.pb.go index 58970fc9..2e1daab8 100644 --- a/cmd/protoc-gen-go/testdata/proto2/fields.pb.go +++ b/cmd/protoc-gen-go/testdata/proto2/fields.pb.go @@ -26,13 +26,11 @@ const ( FieldTestMessage_ONE FieldTestMessage_Enum = 1 ) -// Deprecated: Use FieldTestMessage_Enum.Type.Values instead. var FieldTestMessage_Enum_name = map[int32]string{ 0: "ZERO", 1: "ONE", } -// Deprecated: Use FieldTestMessage_Enum.Type.Values instead. var FieldTestMessage_Enum_value = map[string]int32{ "ZERO": 0, "ONE": 1, diff --git a/cmd/protoc-gen-go/testdata/proto3/enum.pb.go b/cmd/protoc-gen-go/testdata/proto3/enum.pb.go index 97a38fc4..bca782fc 100644 --- a/cmd/protoc-gen-go/testdata/proto3/enum.pb.go +++ b/cmd/protoc-gen-go/testdata/proto3/enum.pb.go @@ -25,14 +25,12 @@ const ( Enum_TWO Enum = 2 ) -// Deprecated: Use Enum.Type.Values instead. var Enum_name = map[int32]string{ 0: "ZERO", 1: "ONE", 2: "TWO", } -// Deprecated: Use Enum.Type.Values instead. var Enum_value = map[string]int32{ "ZERO": 0, "ONE": 1, diff --git a/cmd/protoc-gen-go/testdata/proto3/fields.pb.go b/cmd/protoc-gen-go/testdata/proto3/fields.pb.go index 60236853..e2cdc771 100644 --- a/cmd/protoc-gen-go/testdata/proto3/fields.pb.go +++ b/cmd/protoc-gen-go/testdata/proto3/fields.pb.go @@ -24,12 +24,10 @@ const ( FieldTestMessage_ZERO FieldTestMessage_Enum = 0 ) -// Deprecated: Use FieldTestMessage_Enum.Type.Values instead. var FieldTestMessage_Enum_name = map[int32]string{ 0: "ZERO", } -// Deprecated: Use FieldTestMessage_Enum.Type.Values instead. var FieldTestMessage_Enum_value = map[string]int32{ "ZERO": 0, } diff --git a/encoding/testprotos/pb2/test.pb.go b/encoding/testprotos/pb2/test.pb.go index 738abe79..f47613c6 100644 --- a/encoding/testprotos/pb2/test.pb.go +++ b/encoding/testprotos/pb2/test.pb.go @@ -33,14 +33,12 @@ const ( Enum_TEN Enum = 10 ) -// Deprecated: Use Enum.Type.Values instead. var Enum_name = map[int32]string{ 1: "ONE", 2: "TWO", 10: "TEN", } -// Deprecated: Use Enum.Type.Values instead. var Enum_value = map[string]int32{ "ONE": 1, "TWO": 2, @@ -88,14 +86,12 @@ const ( Enums_DIEZ Enums_NestedEnum = 10 ) -// Deprecated: Use Enums_NestedEnum.Type.Values instead. var Enums_NestedEnum_name = map[int32]string{ 1: "UNO", 2: "DOS", 10: "DIEZ", } -// Deprecated: Use Enums_NestedEnum.Type.Values instead. var Enums_NestedEnum_value = map[string]int32{ "UNO": 1, "DOS": 2, diff --git a/encoding/testprotos/pb3/test.pb.go b/encoding/testprotos/pb3/test.pb.go index 1b0349a4..98079869 100644 --- a/encoding/testprotos/pb3/test.pb.go +++ b/encoding/testprotos/pb3/test.pb.go @@ -27,7 +27,6 @@ const ( Enum_TEN Enum = 10 ) -// Deprecated: Use Enum.Type.Values instead. var Enum_name = map[int32]string{ 0: "ZERO", 1: "ONE", @@ -35,7 +34,6 @@ var Enum_name = map[int32]string{ 10: "TEN", } -// Deprecated: Use Enum.Type.Values instead. var Enum_value = map[string]int32{ "ZERO": 0, "ONE": 1, @@ -75,7 +73,6 @@ const ( Enums_DIEZ Enums_NestedEnum = 10 ) -// Deprecated: Use Enums_NestedEnum.Type.Values instead. var Enums_NestedEnum_name = map[int32]string{ 0: "CERO", 1: "UNO", @@ -83,7 +80,6 @@ var Enums_NestedEnum_name = map[int32]string{ 10: "DIEZ", } -// Deprecated: Use Enums_NestedEnum.Type.Values instead. var Enums_NestedEnum_value = map[string]int32{ "CERO": 0, "UNO": 1, diff --git a/internal/testprotos/conformance/conformance.pb.go b/internal/testprotos/conformance/conformance.pb.go index ccdb64c6..a053a9af 100644 --- a/internal/testprotos/conformance/conformance.pb.go +++ b/internal/testprotos/conformance/conformance.pb.go @@ -28,7 +28,6 @@ const ( WireFormat_TEXT_FORMAT WireFormat = 4 ) -// Deprecated: Use WireFormat.Type.Values instead. var WireFormat_name = map[int32]string{ 0: "UNSPECIFIED", 1: "PROTOBUF", @@ -37,7 +36,6 @@ var WireFormat_name = map[int32]string{ 4: "TEXT_FORMAT", } -// Deprecated: Use WireFormat.Type.Values instead. var WireFormat_value = map[string]int32{ "UNSPECIFIED": 0, "PROTOBUF": 1, @@ -88,7 +86,6 @@ const ( TestCategory_TEXT_FORMAT_TEST TestCategory = 5 ) -// Deprecated: Use TestCategory.Type.Values instead. var TestCategory_name = map[int32]string{ 0: "UNSPECIFIED_TEST", 1: "BINARY_TEST", @@ -98,7 +95,6 @@ var TestCategory_name = map[int32]string{ 5: "TEXT_FORMAT_TEST", } -// Deprecated: Use TestCategory.Type.Values instead. var TestCategory_value = map[string]int32{ "UNSPECIFIED_TEST": 0, "BINARY_TEST": 1, diff --git a/internal/testprotos/conformance/test_messages_proto2.pb.go b/internal/testprotos/conformance/test_messages_proto2.pb.go index df72befa..00b66821 100644 --- a/internal/testprotos/conformance/test_messages_proto2.pb.go +++ b/internal/testprotos/conformance/test_messages_proto2.pb.go @@ -26,14 +26,12 @@ const ( ForeignEnumProto2_FOREIGN_BAZ ForeignEnumProto2 = 2 ) -// Deprecated: Use ForeignEnumProto2.Type.Values instead. var ForeignEnumProto2_name = map[int32]string{ 0: "FOREIGN_FOO", 1: "FOREIGN_BAR", 2: "FOREIGN_BAZ", } -// Deprecated: Use ForeignEnumProto2.Type.Values instead. var ForeignEnumProto2_value = map[string]int32{ "FOREIGN_FOO": 0, "FOREIGN_BAR": 1, @@ -82,7 +80,6 @@ const ( TestAllTypesProto2_NEG TestAllTypesProto2_NestedEnum = -1 ) -// Deprecated: Use TestAllTypesProto2_NestedEnum.Type.Values instead. var TestAllTypesProto2_NestedEnum_name = map[int32]string{ 0: "FOO", 1: "BAR", @@ -90,7 +87,6 @@ var TestAllTypesProto2_NestedEnum_name = map[int32]string{ -1: "NEG", } -// Deprecated: Use TestAllTypesProto2_NestedEnum.Type.Values instead. var TestAllTypesProto2_NestedEnum_value = map[string]int32{ "FOO": 0, "BAR": 1, diff --git a/internal/testprotos/conformance/test_messages_proto3.pb.go b/internal/testprotos/conformance/test_messages_proto3.pb.go index 97e5fefa..75bc2c0a 100644 --- a/internal/testprotos/conformance/test_messages_proto3.pb.go +++ b/internal/testprotos/conformance/test_messages_proto3.pb.go @@ -32,14 +32,12 @@ const ( ForeignEnum_FOREIGN_BAZ ForeignEnum = 2 ) -// Deprecated: Use ForeignEnum.Type.Values instead. var ForeignEnum_name = map[int32]string{ 0: "FOREIGN_FOO", 1: "FOREIGN_BAR", 2: "FOREIGN_BAZ", } -// Deprecated: Use ForeignEnum.Type.Values instead. var ForeignEnum_value = map[string]int32{ "FOREIGN_FOO": 0, "FOREIGN_BAR": 1, @@ -78,7 +76,6 @@ const ( TestAllTypesProto3_NEG TestAllTypesProto3_NestedEnum = -1 ) -// Deprecated: Use TestAllTypesProto3_NestedEnum.Type.Values instead. var TestAllTypesProto3_NestedEnum_name = map[int32]string{ 0: "FOO", 1: "BAR", @@ -86,7 +83,6 @@ var TestAllTypesProto3_NestedEnum_name = map[int32]string{ -1: "NEG", } -// Deprecated: Use TestAllTypesProto3_NestedEnum.Type.Values instead. var TestAllTypesProto3_NestedEnum_value = map[string]int32{ "FOO": 0, "BAR": 1, @@ -128,7 +124,6 @@ const ( TestAllTypesProto3_bAz TestAllTypesProto3_AliasedEnum = 2 ) -// Deprecated: Use TestAllTypesProto3_AliasedEnum.Type.Values instead. var TestAllTypesProto3_AliasedEnum_name = map[int32]string{ 0: "ALIAS_FOO", 1: "ALIAS_BAR", @@ -138,7 +133,6 @@ var TestAllTypesProto3_AliasedEnum_name = map[int32]string{ // Duplicate value: 2: "bAz", } -// Deprecated: Use TestAllTypesProto3_AliasedEnum.Type.Values instead. var TestAllTypesProto3_AliasedEnum_value = map[string]int32{ "ALIAS_FOO": 0, "ALIAS_BAR": 1, diff --git a/internal/testprotos/test/test.pb.go b/internal/testprotos/test/test.pb.go index 809a20c6..d02b5293 100644 --- a/internal/testprotos/test/test.pb.go +++ b/internal/testprotos/test/test.pb.go @@ -27,14 +27,12 @@ const ( ForeignEnum_FOREIGN_BAZ ForeignEnum = 6 ) -// Deprecated: Use ForeignEnum.Type.Values instead. var ForeignEnum_name = map[int32]string{ 4: "FOREIGN_FOO", 5: "FOREIGN_BAR", 6: "FOREIGN_BAZ", } -// Deprecated: Use ForeignEnum.Type.Values instead. var ForeignEnum_value = map[string]int32{ "FOREIGN_FOO": 4, "FOREIGN_BAR": 5, @@ -80,12 +78,10 @@ const ( TestReservedEnumFields_RESERVED_ENUM TestReservedEnumFields = 0 ) -// Deprecated: Use TestReservedEnumFields.Type.Values instead. var TestReservedEnumFields_name = map[int32]string{ 0: "RESERVED_ENUM", } -// Deprecated: Use TestReservedEnumFields.Type.Values instead. var TestReservedEnumFields_value = map[string]int32{ "RESERVED_ENUM": 0, } @@ -132,7 +128,6 @@ const ( TestAllTypes_NEG TestAllTypes_NestedEnum = -1 ) -// Deprecated: Use TestAllTypes_NestedEnum.Type.Values instead. var TestAllTypes_NestedEnum_name = map[int32]string{ 0: "FOO", 1: "BAR", @@ -140,7 +135,6 @@ var TestAllTypes_NestedEnum_name = map[int32]string{ -1: "NEG", } -// Deprecated: Use TestAllTypes_NestedEnum.Type.Values instead. var TestAllTypes_NestedEnum_value = map[string]int32{ "FOO": 0, "BAR": 1, @@ -186,12 +180,10 @@ const ( TestDeprecatedMessage_DEPRECATED TestDeprecatedMessage_DeprecatedEnum = 0 // Deprecated: Do not use. ) -// Deprecated: Use TestDeprecatedMessage_DeprecatedEnum.Type.Values instead. var TestDeprecatedMessage_DeprecatedEnum_name = map[int32]string{ 0: "DEPRECATED", } -// Deprecated: Use TestDeprecatedMessage_DeprecatedEnum.Type.Values instead. var TestDeprecatedMessage_DeprecatedEnum_value = map[string]int32{ "DEPRECATED": 0, } diff --git a/internal/testprotos/test/test_import.pb.go b/internal/testprotos/test/test_import.pb.go index 408b5a49..ea42b56e 100644 --- a/internal/testprotos/test/test_import.pb.go +++ b/internal/testprotos/test/test_import.pb.go @@ -24,12 +24,10 @@ const ( ImportEnum_IMPORT_ZERO ImportEnum = 0 ) -// Deprecated: Use ImportEnum.Type.Values instead. var ImportEnum_name = map[int32]string{ 0: "IMPORT_ZERO", } -// Deprecated: Use ImportEnum.Type.Values instead. var ImportEnum_value = map[string]int32{ "IMPORT_ZERO": 0, } diff --git a/internal/testprotos/test3/test.pb.go b/internal/testprotos/test3/test.pb.go index 471ca03d..a8cb2bc6 100644 --- a/internal/testprotos/test3/test.pb.go +++ b/internal/testprotos/test3/test.pb.go @@ -27,7 +27,6 @@ const ( ForeignEnum_FOREIGN_BAZ ForeignEnum = 6 ) -// Deprecated: Use ForeignEnum.Type.Values instead. var ForeignEnum_name = map[int32]string{ 0: "FOREIGN_ZERO", 4: "FOREIGN_FOO", @@ -35,7 +34,6 @@ var ForeignEnum_name = map[int32]string{ 6: "FOREIGN_BAZ", } -// Deprecated: Use ForeignEnum.Type.Values instead. var ForeignEnum_value = map[string]int32{ "FOREIGN_ZERO": 0, "FOREIGN_FOO": 4, @@ -75,7 +73,6 @@ const ( TestAllTypes_NEG TestAllTypes_NestedEnum = -1 ) -// Deprecated: Use TestAllTypes_NestedEnum.Type.Values instead. var TestAllTypes_NestedEnum_name = map[int32]string{ 0: "FOO", 1: "BAR", @@ -83,7 +80,6 @@ var TestAllTypes_NestedEnum_name = map[int32]string{ -1: "NEG", } -// Deprecated: Use TestAllTypes_NestedEnum.Type.Values instead. var TestAllTypes_NestedEnum_value = map[string]int32{ "FOO": 0, "BAR": 1, diff --git a/internal/testprotos/test3/test_import.pb.go b/internal/testprotos/test3/test_import.pb.go index 5b34c48a..3be06638 100644 --- a/internal/testprotos/test3/test_import.pb.go +++ b/internal/testprotos/test3/test_import.pb.go @@ -24,12 +24,10 @@ const ( ImportEnum_IMPORT_ZERO ImportEnum = 0 ) -// Deprecated: Use ImportEnum.Type.Values instead. var ImportEnum_name = map[int32]string{ 0: "IMPORT_ZERO", } -// Deprecated: Use ImportEnum.Type.Values instead. var ImportEnum_value = map[string]int32{ "IMPORT_ZERO": 0, } diff --git a/reflect/protoregistry/testprotos/test.pb.go b/reflect/protoregistry/testprotos/test.pb.go index 4ed48119..ef91bf9b 100644 --- a/reflect/protoregistry/testprotos/test.pb.go +++ b/reflect/protoregistry/testprotos/test.pb.go @@ -24,12 +24,10 @@ const ( Enum1_ONE Enum1 = 1 ) -// Deprecated: Use Enum1.Type.Values instead. var Enum1_name = map[int32]string{ 1: "ONE", } -// Deprecated: Use Enum1.Type.Values instead. var Enum1_value = map[string]int32{ "ONE": 1, } @@ -73,12 +71,10 @@ const ( Enum2_UNO Enum2 = 1 ) -// Deprecated: Use Enum2.Type.Values instead. var Enum2_name = map[int32]string{ 1: "UNO", } -// Deprecated: Use Enum2.Type.Values instead. var Enum2_value = map[string]int32{ "UNO": 1, } @@ -122,12 +118,10 @@ const ( Enum3_YI Enum3 = 1 ) -// Deprecated: Use Enum3.Type.Values instead. var Enum3_name = map[int32]string{ 1: "YI", } -// Deprecated: Use Enum3.Type.Values instead. var Enum3_value = map[string]int32{ "YI": 1, } diff --git a/types/descriptorpb/descriptor.pb.go b/types/descriptorpb/descriptor.pb.go index d2019e5d..1d003f86 100644 --- a/types/descriptorpb/descriptor.pb.go +++ b/types/descriptorpb/descriptor.pb.go @@ -52,7 +52,6 @@ const ( FieldDescriptorProto_TYPE_SINT64 FieldDescriptorProto_Type = 18 ) -// Deprecated: Use FieldDescriptorProto_Type.Type.Values instead. var FieldDescriptorProto_Type_name = map[int32]string{ 1: "TYPE_DOUBLE", 2: "TYPE_FLOAT", @@ -74,7 +73,6 @@ var FieldDescriptorProto_Type_name = map[int32]string{ 18: "TYPE_SINT64", } -// Deprecated: Use FieldDescriptorProto_Type.Type.Values instead. var FieldDescriptorProto_Type_value = map[string]int32{ "TYPE_DOUBLE": 1, "TYPE_FLOAT": 2, @@ -138,14 +136,12 @@ const ( FieldDescriptorProto_LABEL_REPEATED FieldDescriptorProto_Label = 3 ) -// Deprecated: Use FieldDescriptorProto_Label.Type.Values instead. var FieldDescriptorProto_Label_name = map[int32]string{ 1: "LABEL_OPTIONAL", 2: "LABEL_REQUIRED", 3: "LABEL_REPEATED", } -// Deprecated: Use FieldDescriptorProto_Label.Type.Values instead. var FieldDescriptorProto_Label_value = map[string]int32{ "LABEL_OPTIONAL": 1, "LABEL_REQUIRED": 2, @@ -195,14 +191,12 @@ const ( FileOptions_LITE_RUNTIME FileOptions_OptimizeMode = 3 ) -// Deprecated: Use FileOptions_OptimizeMode.Type.Values instead. var FileOptions_OptimizeMode_name = map[int32]string{ 1: "SPEED", 2: "CODE_SIZE", 3: "LITE_RUNTIME", } -// Deprecated: Use FileOptions_OptimizeMode.Type.Values instead. var FileOptions_OptimizeMode_value = map[string]int32{ "SPEED": 1, "CODE_SIZE": 2, @@ -251,14 +245,12 @@ const ( FieldOptions_STRING_PIECE FieldOptions_CType = 2 ) -// Deprecated: Use FieldOptions_CType.Type.Values instead. var FieldOptions_CType_name = map[int32]string{ 0: "STRING", 1: "CORD", 2: "STRING_PIECE", } -// Deprecated: Use FieldOptions_CType.Type.Values instead. var FieldOptions_CType_value = map[string]int32{ "STRING": 0, "CORD": 1, @@ -309,14 +301,12 @@ const ( FieldOptions_JS_NUMBER FieldOptions_JSType = 2 ) -// Deprecated: Use FieldOptions_JSType.Type.Values instead. var FieldOptions_JSType_name = map[int32]string{ 0: "JS_NORMAL", 1: "JS_STRING", 2: "JS_NUMBER", } -// Deprecated: Use FieldOptions_JSType.Type.Values instead. var FieldOptions_JSType_value = map[string]int32{ "JS_NORMAL": 0, "JS_STRING": 1, @@ -367,14 +357,12 @@ const ( MethodOptions_IDEMPOTENT MethodOptions_IdempotencyLevel = 2 ) -// Deprecated: Use MethodOptions_IdempotencyLevel.Type.Values instead. var MethodOptions_IdempotencyLevel_name = map[int32]string{ 0: "IDEMPOTENCY_UNKNOWN", 1: "NO_SIDE_EFFECTS", 2: "IDEMPOTENT", } -// Deprecated: Use MethodOptions_IdempotencyLevel.Type.Values instead. var MethodOptions_IdempotencyLevel_value = map[string]int32{ "IDEMPOTENCY_UNKNOWN": 0, "NO_SIDE_EFFECTS": 1, diff --git a/types/known/structpb/struct.pb.go b/types/known/structpb/struct.pb.go index 261a9f5f..25d21227 100644 --- a/types/known/structpb/struct.pb.go +++ b/types/known/structpb/struct.pb.go @@ -29,12 +29,10 @@ const ( NullValue_NULL_VALUE NullValue = 0 ) -// Deprecated: Use NullValue.Type.Values instead. var NullValue_name = map[int32]string{ 0: "NULL_VALUE", } -// Deprecated: Use NullValue.Type.Values instead. var NullValue_value = map[string]int32{ "NULL_VALUE": 0, } diff --git a/types/known/typepb/type.pb.go b/types/known/typepb/type.pb.go index dc183e23..d4f4a5a2 100644 --- a/types/known/typepb/type.pb.go +++ b/types/known/typepb/type.pb.go @@ -30,13 +30,11 @@ const ( Syntax_SYNTAX_PROTO3 Syntax = 1 ) -// Deprecated: Use Syntax.Type.Values instead. var Syntax_name = map[int32]string{ 0: "SYNTAX_PROTO2", 1: "SYNTAX_PROTO3", } -// Deprecated: Use Syntax.Type.Values instead. var Syntax_value = map[string]int32{ "SYNTAX_PROTO2": 0, "SYNTAX_PROTO3": 1, @@ -109,7 +107,6 @@ const ( Field_TYPE_SINT64 Field_Kind = 18 ) -// Deprecated: Use Field_Kind.Type.Values instead. var Field_Kind_name = map[int32]string{ 0: "TYPE_UNKNOWN", 1: "TYPE_DOUBLE", @@ -132,7 +129,6 @@ var Field_Kind_name = map[int32]string{ 18: "TYPE_SINT64", } -// Deprecated: Use Field_Kind.Type.Values instead. var Field_Kind_value = map[string]int32{ "TYPE_UNKNOWN": 0, "TYPE_DOUBLE": 1, @@ -192,7 +188,6 @@ const ( Field_CARDINALITY_REPEATED Field_Cardinality = 3 ) -// Deprecated: Use Field_Cardinality.Type.Values instead. var Field_Cardinality_name = map[int32]string{ 0: "CARDINALITY_UNKNOWN", 1: "CARDINALITY_OPTIONAL", @@ -200,7 +195,6 @@ var Field_Cardinality_name = map[int32]string{ 3: "CARDINALITY_REPEATED", } -// Deprecated: Use Field_Cardinality.Type.Values instead. var Field_Cardinality_value = map[string]int32{ "CARDINALITY_UNKNOWN": 0, "CARDINALITY_OPTIONAL": 1,