diff --git a/cmd/protoc-gen-go/testdata/comments/comments.proto b/cmd/protoc-gen-go/testdata/comments/comments.proto index 02998ce3..1c9f1a6e 100644 --- a/cmd/protoc-gen-go/testdata/comments/comments.proto +++ b/cmd/protoc-gen-go/testdata/comments/comments.proto @@ -12,7 +12,7 @@ option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/comme // COMMENT: Enum1.Leading enum Enum1 { // COMMENT: FOO.Leading - FOO = 0; // COMMENT: FOO.InlineTrailing + FOO = 0; // COMMENT: FOO.InlineTrailing // COMMENT: BAR.Leading BAR = 1; // COMMENT: BAR.Trailing1 @@ -24,38 +24,34 @@ enum Enum1 { // COMMENT: Message1.Leading message Message1 { // COMMENT: Message1A.Leading - message Message1A { - } // COMMENT: Message1A.Trailing + message Message1A {} // COMMENT: Message1A.Trailing // COMMENT: Message1B - message Message1B { - } + message Message1B {} // COMMENT: Field1A.Leading - optional string Field1A = 1; // COMMENT: Field1A.Trailing + optional string Field1A = 1; // COMMENT: Field1A.Trailing // COMMENT: Oneof1A.Leading oneof Oneof1a { // COMMENT: Oneof1AField1.Leading - string Oneof1AField1 = 2; // COMMENT: Oneof1AField1.Trailing - } // COMMENT: Oneof1A.Trailing + string Oneof1AField1 = 2; // COMMENT: Oneof1AField1.Trailing + } // COMMENT: Oneof1A.Trailing extensions 100 to max; -} // COMMENT: Message1.Trailing +} // COMMENT: Message1.Trailing // COMMENT: Extend extend Message1 { // COMMENT: Extension.Leading - optional Message1 extension = 100; // COMMENT: Extension.Trailing + optional Message1 extension = 100; // COMMENT: Extension.Trailing } // COMMENT: Message2 message Message2 { // COMMENT: Message2A - message Message2A { - } + message Message2A {} // COMMENT: Message2B - message Message2B { - } + message Message2B {} } diff --git a/cmd/protoc-gen-go/testdata/comments/deprecated.proto b/cmd/protoc-gen-go/testdata/comments/deprecated.proto index daac493b..8dc42865 100644 --- a/cmd/protoc-gen-go/testdata/comments/deprecated.proto +++ b/cmd/protoc-gen-go/testdata/comments/deprecated.proto @@ -11,10 +11,12 @@ option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/comme message DeprecatedMessage { option deprecated = true; - string deprecated_field = 1 [deprecated=true]; + + string deprecated_field = 1 [deprecated = true]; } enum DeprecatedEnum { option deprecated = true; - DEPRECATED = 0 [deprecated=true]; + + DEPRECATED = 0 [deprecated = true]; } diff --git a/cmd/protoc-gen-go/testdata/extensions/base/base.proto b/cmd/protoc-gen-go/testdata/extensions/base/base.proto index 32d242ed..69cbcfc7 100644 --- a/cmd/protoc-gen-go/testdata/extensions/base/base.proto +++ b/cmd/protoc-gen-go/testdata/extensions/base/base.proto @@ -16,5 +16,6 @@ message BaseMessage { message MessageSetWireFormatMessage { option message_set_wire_format = true; + extensions 100 to max; } diff --git a/cmd/protoc-gen-go/testdata/extensions/ext/ext.proto b/cmd/protoc-gen-go/testdata/extensions/ext/ext.proto index 5156c1c6..9ab53d08 100644 --- a/cmd/protoc-gen-go/testdata/extensions/ext/ext.proto +++ b/cmd/protoc-gen-go/testdata/extensions/ext/ext.proto @@ -4,11 +4,11 @@ syntax = "proto2"; +package goproto.protoc.extension.ext; + import "cmd/protoc-gen-go/testdata/extensions/base/base.proto"; import "cmd/protoc-gen-go/testdata/extensions/extra/extra.proto"; -package goproto.protoc.extension.ext; - option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/extensions/ext"; message Message { @@ -23,23 +23,23 @@ enum Enum { // Extend with various types. extend goproto.protoc.extension.base.BaseMessage { - optional bool extension_bool = 101; - optional Enum extension_enum = 102; - optional int32 extension_int32 = 103; - optional sint32 extension_sint32 = 104; - optional uint32 extension_uint32 = 105; - optional int64 extension_int64 = 106; - optional sint64 extension_sint64 = 107; - optional uint64 extension_uint64 = 108; - optional sfixed32 extension_sfixed32 = 109; - optional fixed32 extension_fixed32 = 110; - optional float extension_float = 111; - optional sfixed64 extension_sfixed64 = 112; - optional fixed64 extension_fixed64 = 113; - optional double extension_double = 114; - optional string extension_string = 115; - optional bytes extension_bytes = 116; - optional Message extension_Message = 117; + optional bool extension_bool = 101; + optional Enum extension_enum = 102; + optional int32 extension_int32 = 103; + optional sint32 extension_sint32 = 104; + optional uint32 extension_uint32 = 105; + optional int64 extension_int64 = 106; + optional sint64 extension_sint64 = 107; + optional uint64 extension_uint64 = 108; + optional sfixed32 extension_sfixed32 = 109; + optional fixed32 extension_fixed32 = 110; + optional float extension_float = 111; + optional sfixed64 extension_sfixed64 = 112; + optional fixed64 extension_fixed64 = 113; + optional double extension_double = 114; + optional string extension_string = 115; + optional bytes extension_bytes = 116; + optional Message extension_Message = 117; optional Message.M extension_MessageM = 118; optional group ExtensionGroup = 119 { optional string extension_group = 120; @@ -62,23 +62,23 @@ message ExtendingMessage { // Extend with repeated fields. extend goproto.protoc.extension.base.BaseMessage { - repeated bool repeated_x_bool = 301; - repeated Enum repeated_x_enum = 302; - repeated int32 repeated_x_int32 = 303; - repeated sint32 repeated_x_sint32 = 304; - repeated uint32 repeated_x_uint32 = 305; - repeated int64 repeated_x_int64 = 306; - repeated sint64 repeated_x_sint64 = 307; - repeated uint64 repeated_x_uint64 = 308; + repeated bool repeated_x_bool = 301; + repeated Enum repeated_x_enum = 302; + repeated int32 repeated_x_int32 = 303; + repeated sint32 repeated_x_sint32 = 304; + repeated uint32 repeated_x_uint32 = 305; + repeated int64 repeated_x_int64 = 306; + repeated sint64 repeated_x_sint64 = 307; + repeated uint64 repeated_x_uint64 = 308; repeated sfixed32 repeated_x_sfixed32 = 309; - repeated fixed32 repeated_x_fixed32 = 310; - repeated float repeated_x_float = 311; + repeated fixed32 repeated_x_fixed32 = 310; + repeated float repeated_x_float = 311; repeated sfixed64 repeated_x_sfixed64 = 312; - repeated fixed64 repeated_x_fixed64 = 313; - repeated double repeated_x_double = 314; - repeated string repeated_x_string = 315; - repeated bytes repeated_x_bytes = 316; - repeated Message repeated_x_Message = 317; + repeated fixed64 repeated_x_fixed64 = 313; + repeated double repeated_x_double = 314; + repeated string repeated_x_string = 315; + repeated bytes repeated_x_bytes = 316; + repeated Message repeated_x_Message = 317; repeated group RepeatedGroup = 318 { repeated string repeated_x_group = 319; } diff --git a/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.proto b/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.proto index 3d48c1fa..0110e5fc 100644 --- a/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.proto +++ b/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.proto @@ -4,50 +4,52 @@ syntax = "proto3"; -import "google/protobuf/descriptor.proto"; - package goproto.protoc.extension.proto3; +import "google/protobuf/descriptor.proto"; + option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/extensions/proto3"; message Message {} -enum Enum { ZERO = 0; } +enum Enum { + ZERO = 0; +} // The only types proto3 is allowed to extend are descriptor options. extend google.protobuf.MessageOptions { - bool extension_bool = 1001; - Enum extension_enum = 1002; - int32 extension_int32 = 1003; - sint32 extension_sint32 = 1004; - uint32 extension_uint32 = 1005; - int64 extension_int64 = 1006; - sint64 extension_sint64 = 1007; - uint64 extension_uint64 = 1008; + bool extension_bool = 1001; + Enum extension_enum = 1002; + int32 extension_int32 = 1003; + sint32 extension_sint32 = 1004; + uint32 extension_uint32 = 1005; + int64 extension_int64 = 1006; + sint64 extension_sint64 = 1007; + uint64 extension_uint64 = 1008; sfixed32 extension_sfixed32 = 1009; - fixed32 extension_fixed32 = 1010; - float extension_float = 1011; + fixed32 extension_fixed32 = 1010; + float extension_float = 1011; sfixed64 extension_sfixed64 = 1012; - fixed64 extension_fixed64 = 1013; - double extension_double = 1014; - string extension_string = 1015; - bytes extension_bytes = 1016; - Message extension_Message = 1017; + fixed64 extension_fixed64 = 1013; + double extension_double = 1014; + string extension_string = 1015; + bytes extension_bytes = 1016; + Message extension_Message = 1017; - repeated bool repeated_extension_bool = 2001; - repeated Enum repeated_extension_enum = 2002; - repeated int32 repeated_extension_int32 = 2003; - repeated sint32 repeated_extension_sint32 = 2004; - repeated uint32 repeated_extension_uint32 = 2005; - repeated int64 repeated_extension_int64 = 2006; - repeated sint64 repeated_extension_sint64 = 2007; - repeated uint64 repeated_extension_uint64 = 2008; + repeated bool repeated_extension_bool = 2001; + repeated Enum repeated_extension_enum = 2002; + repeated int32 repeated_extension_int32 = 2003; + repeated sint32 repeated_extension_sint32 = 2004; + repeated uint32 repeated_extension_uint32 = 2005; + repeated int64 repeated_extension_int64 = 2006; + repeated sint64 repeated_extension_sint64 = 2007; + repeated uint64 repeated_extension_uint64 = 2008; repeated sfixed32 repeated_extension_sfixed32 = 2009; - repeated fixed32 repeated_extension_fixed32 = 2010; - repeated float repeated_extension_float = 2011; + repeated fixed32 repeated_extension_fixed32 = 2010; + repeated float repeated_extension_float = 2011; repeated sfixed64 repeated_extension_sfixed64 = 2012; - repeated fixed64 repeated_extension_fixed64 = 2013; - repeated double repeated_extension_double = 2014; - repeated string repeated_extension_string = 2015; - repeated bytes repeated_extension_bytes = 2016; - repeated Message repeated_extension_Message = 2017; + repeated fixed64 repeated_extension_fixed64 = 2013; + repeated double repeated_extension_double = 2014; + repeated string repeated_extension_string = 2015; + repeated bytes repeated_extension_bytes = 2016; + repeated Message repeated_extension_Message = 2017; } diff --git a/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.proto b/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.proto index 00f6752e..56943558 100644 --- a/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.proto +++ b/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.proto @@ -29,8 +29,8 @@ message Message { // Field names that conflict with each other after CamelCasing. optional string CamelCase = 20; optional string CamelCase_ = 21; - optional string camel_case = 22; // conflicts with 20, 21 - optional string CamelCase__ = 23; // conflicts with 21, 21, renamed 22 + optional string camel_case = 22; // conflicts with 20, 21 + optional string CamelCase__ = 23; // conflicts with 21, 21, renamed 22 // Field with a getter that conflicts with another field. optional string get_name = 30; 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 e00b5488..9a162e6b 100644 --- a/cmd/protoc-gen-go/testdata/import_public/a.pb.go +++ b/cmd/protoc-gen-go/testdata/import_public/a.pb.go @@ -124,13 +124,13 @@ var file_cmd_protoc_gen_go_testdata_import_public_a_proto_rawDesc = []byte{ 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2e, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x1a, 0x34, 0x63, 0x6d, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, + 0x1a, 0x30, 0x63, 0x6d, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x69, 0x6d, 0x70, - 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x73, 0x75, 0x62, 0x2f, 0x61, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x30, 0x63, 0x6d, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, - 0x74, 0x61, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x2f, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa9, 0x01, 0x0a, 0x06, 0x50, 0x75, 0x62, + 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x62, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x34, 0x63, 0x6d, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, + 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x69, + 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x73, 0x75, 0x62, + 0x2f, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa9, 0x01, 0x0a, 0x06, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x31, 0x0a, 0x01, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2e, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x73, 0x75, diff --git a/cmd/protoc-gen-go/testdata/import_public/a.proto b/cmd/protoc-gen-go/testdata/import_public/a.proto index 62101252..aa79b1b8 100644 --- a/cmd/protoc-gen-go/testdata/import_public/a.proto +++ b/cmd/protoc-gen-go/testdata/import_public/a.proto @@ -6,10 +6,13 @@ syntax = "proto2"; package goproto.protoc.import_public; -option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/import_public"; +// Same Go package. +import public "cmd/protoc-gen-go/testdata/import_public/b.proto"; -import public "cmd/protoc-gen-go/testdata/import_public/sub/a.proto"; // Different Go package. -import public "cmd/protoc-gen-go/testdata/import_public/b.proto"; // Same Go package. +// Different Go package. +import public "cmd/protoc-gen-go/testdata/import_public/sub/a.proto"; + +option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/import_public"; message Public { optional goproto.protoc.import_public.sub.M m = 1; diff --git a/cmd/protoc-gen-go/testdata/import_public/b.proto b/cmd/protoc-gen-go/testdata/import_public/b.proto index f710dcec..d4091138 100644 --- a/cmd/protoc-gen-go/testdata/import_public/b.proto +++ b/cmd/protoc-gen-go/testdata/import_public/b.proto @@ -6,10 +6,10 @@ syntax = "proto2"; package goproto.protoc.import_public; -option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/import_public"; - import "cmd/protoc-gen-go/testdata/import_public/sub/a.proto"; +option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/import_public"; + message Local { optional goproto.protoc.import_public.sub.M m = 1; optional goproto.protoc.import_public.sub.E e = 2; diff --git a/cmd/protoc-gen-go/testdata/import_public/c.proto b/cmd/protoc-gen-go/testdata/import_public/c.proto index 86b02a38..d51f1e0e 100644 --- a/cmd/protoc-gen-go/testdata/import_public/c.proto +++ b/cmd/protoc-gen-go/testdata/import_public/c.proto @@ -6,14 +6,14 @@ syntax = "proto2"; package goproto.protoc.import_public; -option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/import_public"; - import "cmd/protoc-gen-go/testdata/import_public/a.proto"; +option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/import_public"; + message UsingPublicImport { // Local is declared in b.proto, which is a public import of a.proto. optional Local local = 1; // Sub2Message is declared in sub2/a.proto, which is a public import of // sub/a.proto, which is a public import of a.proto. - optional sub2.Sub2Message sub2 = 2; // declared in sub2/a.proto + optional sub2.Sub2Message sub2 = 2; // declared in sub2/a.proto } 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 7f83f6d3..23bdda3e 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 @@ -411,13 +411,13 @@ var file_cmd_protoc_gen_go_testdata_import_public_sub_a_proto_rawDesc = []byte{ 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x73, 0x75, 0x62, 0x2f, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x20, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2e, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x73, 0x75, 0x62, 0x1a, 0x34, 0x63, 0x6d, 0x64, 0x2f, 0x70, 0x72, + 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x73, 0x75, 0x62, 0x1a, 0x35, 0x63, 0x6d, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x2f, 0x73, 0x75, 0x62, 0x2f, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x35, - 0x63, 0x6d, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, - 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, - 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x73, 0x75, 0x62, 0x32, 0x2f, 0x61, 0x2e, + 0x69, 0x63, 0x2f, 0x73, 0x75, 0x62, 0x32, 0x2f, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x34, 0x63, 0x6d, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, + 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x69, 0x6d, 0x70, 0x6f, + 0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x73, 0x75, 0x62, 0x2f, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb6, 0x03, 0x0a, 0x01, 0x4d, 0x12, 0x34, 0x0a, 0x02, 0x6d, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2e, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, @@ -456,7 +456,7 @@ var file_cmd_protoc_gen_go_testdata_import_public_sub_a_proto_rawDesc = []byte{ 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x63, 0x6d, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x2f, 0x73, 0x75, 0x62, 0x50, 0x01, + 0x69, 0x63, 0x2f, 0x73, 0x75, 0x62, 0x50, 0x00, } var ( diff --git a/cmd/protoc-gen-go/testdata/import_public/sub/a.proto b/cmd/protoc-gen-go/testdata/import_public/sub/a.proto index 9fa4cb85..11019265 100644 --- a/cmd/protoc-gen-go/testdata/import_public/sub/a.proto +++ b/cmd/protoc-gen-go/testdata/import_public/sub/a.proto @@ -6,17 +6,18 @@ syntax = "proto2"; package goproto.protoc.import_public.sub; -option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/import_public/sub"; +import public "cmd/protoc-gen-go/testdata/import_public/sub2/a.proto"; import "cmd/protoc-gen-go/testdata/import_public/sub/b.proto"; -import public "cmd/protoc-gen-go/testdata/import_public/sub2/a.proto"; + +option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/import_public/sub"; message M { // Field using a type in the same Go package, but a different source file. optional M2 m2 = 1; - optional string s = 4 [default="default"]; - optional bytes b = 5 [default="default"]; - optional double f = 6 [default=nan]; + optional string s = 4 [default = "default"]; + optional bytes b = 5 [default = "default"]; + optional double f = 6 [default = nan]; oneof oneof_field { int32 oneof_int32 = 2; diff --git a/cmd/protoc-gen-go/testdata/import_public/sub/b.proto b/cmd/protoc-gen-go/testdata/import_public/sub/b.proto index 2f1bb5d6..cfb99699 100644 --- a/cmd/protoc-gen-go/testdata/import_public/sub/b.proto +++ b/cmd/protoc-gen-go/testdata/import_public/sub/b.proto @@ -8,5 +8,4 @@ package goproto.protoc.import_public.sub; option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/import_public/sub"; -message M2 { -} +message M2 {} diff --git a/cmd/protoc-gen-go/testdata/imports/fmt/m.proto b/cmd/protoc-gen-go/testdata/imports/fmt/m.proto index 580c2b5d..c6a3ea99 100644 --- a/cmd/protoc-gen-go/testdata/imports/fmt/m.proto +++ b/cmd/protoc-gen-go/testdata/imports/fmt/m.proto @@ -3,6 +3,9 @@ // license that can be found in the LICENSE file. syntax = "proto3"; + package fmt; + option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports/fmt"; + message M {} diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.proto b/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.proto index 0c2f3e12..551d512b 100644 --- a/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.proto +++ b/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.proto @@ -3,7 +3,9 @@ // license that can be found in the LICENSE file. syntax = "proto3"; + package test.a; + option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports/test_a_1"; message M1 {} diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.proto b/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.proto index 31aa9096..b82d023f 100644 --- a/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.proto +++ b/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.proto @@ -3,6 +3,9 @@ // license that can be found in the LICENSE file. syntax = "proto3"; + package test.a; + option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports/test_a_1"; + message M2 {} diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.proto b/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.proto index c9b3f346..3bfff729 100644 --- a/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.proto +++ b/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.proto @@ -3,6 +3,9 @@ // license that can be found in the LICENSE file. syntax = "proto3"; + package test.a; + option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports/test_a_2"; + message M3 {} diff --git a/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.proto b/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.proto index 248e0732..3d808f99 100644 --- a/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.proto +++ b/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.proto @@ -3,6 +3,9 @@ // license that can be found in the LICENSE file. syntax = "proto3"; + package test.a; + option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports/test_a_2"; + message M4 {} diff --git a/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.proto b/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.proto index 77e0fc6e..1b933190 100644 --- a/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.proto +++ b/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.proto @@ -3,6 +3,9 @@ // license that can be found in the LICENSE file. syntax = "proto3"; + package test.b.part1; + option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports/test_b_1;beta"; + message M1 {} diff --git a/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.proto b/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.proto index ed68630c..0b215bfc 100644 --- a/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.proto +++ b/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.proto @@ -3,6 +3,9 @@ // license that can be found in the LICENSE file. syntax = "proto3"; + package test.b.part2; + option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports/test_b_1;beta"; + message M2 {} diff --git a/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.proto b/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.proto index 670e62e2..48fb17c0 100644 --- a/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.proto +++ b/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.proto @@ -6,10 +6,10 @@ syntax = "proto3"; package test; -option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports"; - import "cmd/protoc-gen-go/testdata/imports/test_a_1/m1.proto"; +option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports"; + message A1M1 { test.a.M1 f = 1; } diff --git a/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.proto b/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.proto index 8cef2809..a11c0d13 100644 --- a/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.proto +++ b/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.proto @@ -6,10 +6,10 @@ syntax = "proto3"; package test; -option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports"; - import "cmd/protoc-gen-go/testdata/imports/test_a_1/m2.proto"; +option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/imports"; + message A1M2 { test.a.M2 f = 1; } 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 288e5246..7e499a30 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 @@ -104,6 +104,9 @@ var file_cmd_protoc_gen_go_testdata_imports_test_import_all_proto_rawDesc = []by 0x2d, 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x74, 0x65, 0x73, 0x74, + 0x1a, 0x2e, 0x63, 0x6d, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, + 0x2d, 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x69, 0x6d, 0x70, + 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x66, 0x6d, 0x74, 0x2f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x34, 0x63, 0x6d, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x5f, 0x31, 0x2f, 0x6d, 0x31, @@ -124,9 +127,6 @@ var file_cmd_protoc_gen_go_testdata_imports_test_import_all_proto_rawDesc = []by 0x63, 0x6d, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x5f, 0x31, 0x2f, 0x6d, 0x32, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x63, 0x6d, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, - 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x66, 0x6d, 0x74, 0x2f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa3, 0x01, 0x0a, 0x03, 0x41, 0x6c, 0x6c, 0x12, 0x1c, 0x0a, 0x03, 0x61, 0x6d, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x2e, 0x4d, 0x31, 0x52, 0x03, 0x61, 0x6d, 0x31, 0x12, 0x1c, 0x0a, 0x03, 0x61, 0x6d, diff --git a/cmd/protoc-gen-go/testdata/imports/test_import_all.proto b/cmd/protoc-gen-go/testdata/imports/test_import_all.proto index 3909f2de..2af29cbc 100644 --- a/cmd/protoc-gen-go/testdata/imports/test_import_all.proto +++ b/cmd/protoc-gen-go/testdata/imports/test_import_all.proto @@ -12,13 +12,13 @@ option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/impor // test_a_*/*.proto are in different Go packages, but the same proto package. // test_b_1/*.proto are in the same Go package, but different proto packages. // fmt/m.proto has a package name which conflicts with "fmt". +import "cmd/protoc-gen-go/testdata/imports/fmt/m.proto"; import "cmd/protoc-gen-go/testdata/imports/test_a_1/m1.proto"; import "cmd/protoc-gen-go/testdata/imports/test_a_1/m2.proto"; import "cmd/protoc-gen-go/testdata/imports/test_a_2/m3.proto"; // unused in this file import "cmd/protoc-gen-go/testdata/imports/test_a_2/m4.proto"; // unused in this file import "cmd/protoc-gen-go/testdata/imports/test_b_1/m1.proto"; import "cmd/protoc-gen-go/testdata/imports/test_b_1/m2.proto"; -import "cmd/protoc-gen-go/testdata/imports/fmt/m.proto"; message All { test.a.M1 am1 = 1; diff --git a/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.proto b/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.proto index d6d269da..db0a6553 100644 --- a/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.proto +++ b/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.proto @@ -9,7 +9,7 @@ package oneoftest; option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/issue780_oneof_conflict"; message Foo { - oneof bar { // must be generated as Bar field in Foo struct - string get_bar = 1; - } + oneof bar { // must be generated as Bar field in Foo struct + string get_bar = 1; + } } diff --git a/cmd/protoc-gen-go/testdata/nopackage/nopackage.proto b/cmd/protoc-gen-go/testdata/nopackage/nopackage.proto index 892bb066..97fa6fde 100644 --- a/cmd/protoc-gen-go/testdata/nopackage/nopackage.proto +++ b/cmd/protoc-gen-go/testdata/nopackage/nopackage.proto @@ -12,5 +12,5 @@ enum Enum { message Message { optional string string_field = 1; - optional Enum enum_field = 2 [default=ZERO]; + optional Enum enum_field = 2 [default = ZERO]; } diff --git a/cmd/protoc-gen-go/testdata/proto2/enum.proto b/cmd/protoc-gen-go/testdata/proto2/enum.proto index c30c8ecf..b5217d74 100644 --- a/cmd/protoc-gen-go/testdata/proto2/enum.proto +++ b/cmd/protoc-gen-go/testdata/proto2/enum.proto @@ -18,6 +18,7 @@ enum EnumType1 { enum EnumType2 { option allow_alias = true; + duplicate1 = 1; duplicate2 = 1; @@ -27,8 +28,8 @@ enum EnumType2 { } message EnumContainerMessage1 { - optional EnumType2 default_duplicate1 = 1 [default=duplicate1]; - optional EnumType2 default_duplicate2 = 2 [default=duplicate2]; + optional EnumType2 default_duplicate1 = 1 [default = duplicate1]; + optional EnumType2 default_duplicate2 = 2 [default = duplicate2]; // NestedEnumType1A comment. enum NestedEnumType1A { diff --git a/cmd/protoc-gen-go/testdata/proto2/fields.proto b/cmd/protoc-gen-go/testdata/proto2/fields.proto index f3c4c915..c2e1f001 100644 --- a/cmd/protoc-gen-go/testdata/proto2/fields.proto +++ b/cmd/protoc-gen-go/testdata/proto2/fields.proto @@ -9,118 +9,118 @@ package goproto.protoc.proto2; option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/proto2"; message FieldTestMessage { - optional bool optional_bool = 1; - optional Enum optional_enum = 2; - optional int32 optional_int32 = 3; - optional sint32 optional_sint32 = 4; - optional uint32 optional_uint32 = 5; - optional int64 optional_int64 = 6; - optional sint64 optional_sint64 = 7; - optional uint64 optional_uint64 = 8; + optional bool optional_bool = 1; + optional Enum optional_enum = 2; + optional int32 optional_int32 = 3; + optional sint32 optional_sint32 = 4; + optional uint32 optional_uint32 = 5; + optional int64 optional_int64 = 6; + optional sint64 optional_sint64 = 7; + optional uint64 optional_uint64 = 8; optional sfixed32 optional_sfixed32 = 9; - optional fixed32 optional_fixed32 = 10; - optional float optional_float = 11; + optional fixed32 optional_fixed32 = 10; + optional float optional_float = 11; optional sfixed64 optional_sfixed64 = 12; - optional fixed64 optional_fixed64 = 13; - optional double optional_double = 14; - optional string optional_string = 15; - optional bytes optional_bytes = 16; - optional Message optional_Message = 17; + optional fixed64 optional_fixed64 = 13; + optional double optional_double = 14; + optional string optional_string = 15; + optional bytes optional_bytes = 16; + optional Message optional_Message = 17; optional group OptionalGroup = 18 { optional string optional_group = 19; } - required bool required_bool = 101; - required Enum required_enum = 102; - required int32 required_int32 = 103; - required sint32 required_sint32 = 104; - required uint32 required_uint32 = 105; - required int64 required_int64 = 106; - required sint64 required_sint64 = 107; - required uint64 required_uint64 = 108; + required bool required_bool = 101; + required Enum required_enum = 102; + required int32 required_int32 = 103; + required sint32 required_sint32 = 104; + required uint32 required_uint32 = 105; + required int64 required_int64 = 106; + required sint64 required_sint64 = 107; + required uint64 required_uint64 = 108; required sfixed32 required_sfixed32 = 109; - required fixed32 required_fixed32 = 110; - required float required_float = 111; + required fixed32 required_fixed32 = 110; + required float required_float = 111; required sfixed64 required_sfixed64 = 112; - required fixed64 required_fixed64 = 113; - required double required_double = 114; - required string required_string = 115; - required bytes required_bytes = 116; - required Message required_Message = 117; + required fixed64 required_fixed64 = 113; + required double required_double = 114; + required string required_string = 115; + required bytes required_bytes = 116; + required Message required_Message = 117; required group RequiredGroup = 118 { required string required_group = 119; } - repeated bool repeated_bool = 201; - repeated Enum repeated_enum = 202; - repeated int32 repeated_int32 = 203; - repeated sint32 repeated_sint32 = 204; - repeated uint32 repeated_uint32 = 205; - repeated int64 repeated_int64 = 206; - repeated sint64 repeated_sint64 = 207; - repeated uint64 repeated_uint64 = 208; + repeated bool repeated_bool = 201; + repeated Enum repeated_enum = 202; + repeated int32 repeated_int32 = 203; + repeated sint32 repeated_sint32 = 204; + repeated uint32 repeated_uint32 = 205; + repeated int64 repeated_int64 = 206; + repeated sint64 repeated_sint64 = 207; + repeated uint64 repeated_uint64 = 208; repeated sfixed32 repeated_sfixed32 = 209; - repeated fixed32 repeated_fixed32 = 210; - repeated float repeated_float = 211; + repeated fixed32 repeated_fixed32 = 210; + repeated float repeated_float = 211; repeated sfixed64 repeated_sfixed64 = 212; - repeated fixed64 repeated_fixed64 = 213; - repeated double repeated_double = 214; - repeated string repeated_string = 215; - repeated bytes repeated_bytes = 216; - repeated Message repeated_Message = 217; + repeated fixed64 repeated_fixed64 = 213; + repeated double repeated_double = 214; + repeated string repeated_string = 215; + repeated bytes repeated_bytes = 216; + repeated Message repeated_Message = 217; repeated group RepeatedGroup = 218 { repeated string repeated_group = 219; } - optional bool default_bool = 301 [default=true]; - optional Enum default_enum = 302 [default=ONE]; - optional int32 default_int32 = 303 [default=1]; - optional sint32 default_sint32 = 304 [default=1]; - optional uint32 default_uint32 = 305 [default=1]; - optional int64 default_int64 = 306 [default=1]; - optional sint64 default_sint64 = 307 [default=1]; - optional uint64 default_uint64 = 308 [default=1]; - optional sfixed32 default_sfixed32 = 309 [default=1]; - optional fixed32 default_fixed32 = 310 [default=1]; - optional float default_float = 311 [default=3.14]; - optional sfixed64 default_sfixed64 = 312 [default=1]; - optional fixed64 default_fixed64 = 313 [default=1]; - optional double default_double = 314 [default=3.1415]; - optional string default_string = 315 [default="hello,\"world!\"\n"]; - optional bytes default_bytes = 316 [default="hello,\xde\xad\xbe\xef"]; + optional bool default_bool = 301 [default = true]; + optional Enum default_enum = 302 [default = ONE]; + optional int32 default_int32 = 303 [default = 1]; + optional sint32 default_sint32 = 304 [default = 1]; + optional uint32 default_uint32 = 305 [default = 1]; + optional int64 default_int64 = 306 [default = 1]; + optional sint64 default_sint64 = 307 [default = 1]; + optional uint64 default_uint64 = 308 [default = 1]; + optional sfixed32 default_sfixed32 = 309 [default = 1]; + optional fixed32 default_fixed32 = 310 [default = 1]; + optional float default_float = 311 [default = 3.14]; + optional sfixed64 default_sfixed64 = 312 [default = 1]; + optional fixed64 default_fixed64 = 313 [default = 1]; + optional double default_double = 314 [default = 3.1415]; + optional string default_string = 315 [default = "hello,\"world!\"\n"]; + optional bytes default_bytes = 316 [default = "hello,\xde\xad\xbe\xef"]; - optional string default_zero_string = 350 [default=""]; - optional bytes default_zero_bytes = 351 [default=""]; + optional string default_zero_string = 350 [default = ""]; + optional bytes default_zero_bytes = 351 [default = ""]; - optional float default_float_neginf = 400 [default=-inf]; - optional float default_float_posinf = 401 [default=inf]; - optional float default_float_nan = 402 [default=nan]; - optional double default_double_neginf = 403 [default=-inf]; - optional double default_double_posinf = 404 [default=inf]; - optional double default_double_nan = 405 [default=nan]; + optional float default_float_neginf = 400 [default = -inf]; + optional float default_float_posinf = 401 [default = inf]; + optional float default_float_nan = 402 [default = nan]; + optional double default_double_neginf = 403 [default = -inf]; + optional double default_double_posinf = 404 [default = inf]; + optional double default_double_nan = 405 [default = nan]; - map<int32, int64> map_int32_int64 = 500; - map<string,Message> map_string_message = 501; - map<fixed64,Enum> map_fixed64_enum = 502; + map<int32, int64> map_int32_int64 = 500; + map<string, Message> map_string_message = 501; + map<fixed64, Enum> map_fixed64_enum = 502; oneof oneof_field { - bool oneof_bool = 601; - Enum oneof_enum = 602; - int32 oneof_int32 = 603; - sint32 oneof_sint32 = 604; - uint32 oneof_uint32 = 605; - int64 oneof_int64 = 606; - sint64 oneof_sint64 = 607; - uint64 oneof_uint64 = 608; + bool oneof_bool = 601; + Enum oneof_enum = 602; + int32 oneof_int32 = 603; + sint32 oneof_sint32 = 604; + uint32 oneof_uint32 = 605; + int64 oneof_int64 = 606; + sint64 oneof_sint64 = 607; + uint64 oneof_uint64 = 608; sfixed32 oneof_sfixed32 = 609; - fixed32 oneof_fixed32 = 610; - float oneof_float = 611; + fixed32 oneof_fixed32 = 610; + float oneof_float = 611; sfixed64 oneof_sfixed64 = 612; - fixed64 oneof_fixed64 = 613; - double oneof_double = 614; - string oneof_string = 615; - bytes oneof_bytes = 616; - Message oneof_Message = 617; + fixed64 oneof_fixed64 = 613; + double oneof_double = 614; + string oneof_string = 615; + bytes oneof_bytes = 616; + Message oneof_Message = 617; group OneofGroup = 618 { optional string oneof_group_field = 619; } diff --git a/cmd/protoc-gen-go/testdata/proto2/nested_messages.proto b/cmd/protoc-gen-go/testdata/proto2/nested_messages.proto index e42af75f..5aadac44 100644 --- a/cmd/protoc-gen-go/testdata/proto2/nested_messages.proto +++ b/cmd/protoc-gen-go/testdata/proto2/nested_messages.proto @@ -10,8 +10,7 @@ option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/proto message Layer1 { message Layer2 { - message Layer3 { - } + message Layer3 {} optional Layer3 l3 = 1; } optional Layer2 l2 = 1; diff --git a/cmd/protoc-gen-go/testdata/proto3/fields.proto b/cmd/protoc-gen-go/testdata/proto3/fields.proto index 1dfd7057..7031a748 100644 --- a/cmd/protoc-gen-go/testdata/proto3/fields.proto +++ b/cmd/protoc-gen-go/testdata/proto3/fields.proto @@ -9,47 +9,48 @@ package goproto.protoc.proto3; option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/proto3"; message FieldTestMessage { - string optional_bool = 1; - Enum optional_enum = 2; - int32 optional_int32 = 3; - sint32 optional_sint32 = 4; - uint32 optional_uint32 = 5; - int64 optional_int64 = 6; - sint64 optional_sint64 = 7; - uint64 optional_uint64 = 8; + string optional_bool = 1; + Enum optional_enum = 2; + int32 optional_int32 = 3; + sint32 optional_sint32 = 4; + uint32 optional_uint32 = 5; + int64 optional_int64 = 6; + sint64 optional_sint64 = 7; + uint64 optional_uint64 = 8; sfixed32 optional_sfixed32 = 9; - fixed32 optional_fixed32 = 10; - float optional_float = 11; + fixed32 optional_fixed32 = 10; + float optional_float = 11; sfixed64 optional_sfixed64 = 12; - fixed64 optional_fixed64 = 13; - double optional_double = 14; - string optional_string = 15; - bytes optional_bytes = 16; - Message optional_Message = 17; + fixed64 optional_fixed64 = 13; + double optional_double = 14; + string optional_string = 15; + bytes optional_bytes = 16; + Message optional_Message = 17; - repeated bool repeated_bool = 201; - repeated Enum repeated_enum = 202; - repeated int32 repeated_int32 = 203; - repeated sint32 repeated_sint32 = 204; - repeated uint32 repeated_uint32 = 205; - repeated int64 repeated_int64 = 206; - repeated sint64 repeated_sint64 = 207; - repeated uint64 repeated_uint64 = 208; + repeated bool repeated_bool = 201; + repeated Enum repeated_enum = 202; + repeated int32 repeated_int32 = 203; + repeated sint32 repeated_sint32 = 204; + repeated uint32 repeated_uint32 = 205; + repeated int64 repeated_int64 = 206; + repeated sint64 repeated_sint64 = 207; + repeated uint64 repeated_uint64 = 208; repeated sfixed32 repeated_sfixed32 = 209; - repeated fixed32 repeated_fixed32 = 210; - repeated float repeated_float = 211; + repeated fixed32 repeated_fixed32 = 210; + repeated float repeated_float = 211; repeated sfixed64 repeated_sfixed64 = 212; - repeated fixed64 repeated_fixed64 = 213; - repeated double repeated_double = 214; - repeated string repeated_string = 215; - repeated bytes repeated_bytes = 216; - repeated Message repeated_Message = 217; + repeated fixed64 repeated_fixed64 = 213; + repeated double repeated_double = 214; + repeated string repeated_string = 215; + repeated bytes repeated_bytes = 216; + repeated Message repeated_Message = 217; - map<int32, int64> map_int32_int64 = 500; - map<string,Message> map_string_message = 501; - map<fixed64,Enum> map_fixed64_enum = 502; + map<int32, int64> map_int32_int64 = 500; + map<string, Message> map_string_message = 501; + map<fixed64, Enum> map_fixed64_enum = 502; - enum Enum { ZERO = 0; } + enum Enum { + ZERO = 0; + } message Message {} } - diff --git a/cmd/protoc-gen-go/testdata/retention/options_message.proto b/cmd/protoc-gen-go/testdata/retention/options_message.proto index afa6cd44..8a0ef6bc 100644 --- a/cmd/protoc-gen-go/testdata/retention/options_message.proto +++ b/cmd/protoc-gen-go/testdata/retention/options_message.proto @@ -27,4 +27,4 @@ extend google.protobuf.FileOptions { extend google.protobuf.FileOptions { optional OptionsMessage file_option = 504871168; -} \ No newline at end of file +} diff --git a/cmd/protoc-gen-go/testdata/retention/retention.proto b/cmd/protoc-gen-go/testdata/retention/retention.proto index e409a132..130b1d5f 100644 --- a/cmd/protoc-gen-go/testdata/retention/retention.proto +++ b/cmd/protoc-gen-go/testdata/retention/retention.proto @@ -10,7 +10,6 @@ import "cmd/protoc-gen-go/testdata/retention/options_message.proto"; import "google/protobuf/descriptor.proto"; option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/retention"; - option (imported_plain_option) = 1; option (imported_runtime_retention_option) = 2; option (imported_source_retention_option) = 3; @@ -173,4 +172,4 @@ service Service { source_retention_field: 3 }; } -} \ No newline at end of file +} diff --git a/internal/testprotos/editionsfuzztest/test3editions.proto b/internal/testprotos/editionsfuzztest/test3editions.proto index 5efb1966..898260b6 100644 --- a/internal/testprotos/editionsfuzztest/test3editions.proto +++ b/internal/testprotos/editionsfuzztest/test3editions.proto @@ -74,7 +74,8 @@ message TestAllTypesProto3Editions { NestedMessage optional_nested_message = 18; ForeignMessageProto3Editions optional_foreign_message = 19; NestedEnum optional_nested_enum = 21 [features.field_presence = EXPLICIT]; - ForeignEnumProto3Editions optional_foreign_enum = 22 [features.field_presence = EXPLICIT]; + ForeignEnumProto3Editions optional_foreign_enum = 22 + [features.field_presence = EXPLICIT]; repeated int32 repeated_int32 = 31; repeated int64 repeated_int64 = 32; diff --git a/internal/testprotos/fieldtrack/fieldtrack.pb.go b/internal/testprotos/fieldtrack/fieldtrack.pb.go index 4cbb98ba..d2a9812c 100644 --- a/internal/testprotos/fieldtrack/fieldtrack.pb.go +++ b/internal/testprotos/fieldtrack/fieldtrack.pb.go @@ -620,18 +620,18 @@ var file_internal_testprotos_fieldtrack_fieldtrack_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, + 0x77, 0x65, 0x61, 0x6b, 0x31, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x77, 0x65, 0x61, 0x6b, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, + 0x77, 0x65, 0x61, 0x6b, 0x32, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x77, 0x65, 0x61, 0x6b, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, - 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, - 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x77, 0x65, 0x61, 0x6b, 0x31, 0x2f, 0x74, 0x65, 0x73, 0x74, - 0x5f, 0x77, 0x65, 0x61, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, - 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x77, 0x65, 0x61, 0x6b, 0x32, 0x2f, 0x74, 0x65, 0x73, 0x74, - 0x5f, 0x77, 0x65, 0x61, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfe, 0x24, 0x0a, 0x0e, + 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfe, 0x24, 0x0a, 0x0e, 0x54, 0x65, 0x73, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x12, 0x25, 0x0a, 0x0e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, @@ -931,7 +931,7 @@ var file_internal_testprotos_fieldtrack_fieldtrack_proto_rawDesc = []byte{ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x58, 0x02, 0x58, 0x03, + 0x69, 0x65, 0x6c, 0x64, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x58, 0x00, 0x58, 0x01, } var ( diff --git a/internal/testprotos/fieldtrack/fieldtrack.proto b/internal/testprotos/fieldtrack/fieldtrack.proto index 4e727e64..79c338f2 100644 --- a/internal/testprotos/fieldtrack/fieldtrack.proto +++ b/internal/testprotos/fieldtrack/fieldtrack.proto @@ -6,70 +6,74 @@ syntax = "proto2"; package goproto.proto.test; -import "internal/testprotos/annotation/annotation.proto"; -import "internal/testprotos/test/test.proto"; import weak "internal/testprotos/test/weak1/test_weak.proto"; import weak "internal/testprotos/test/weak2/test_weak.proto"; +import "internal/testprotos/annotation/annotation.proto"; +import "internal/testprotos/test/test.proto"; + option go_package = "google.golang.org/protobuf/internal/testprotos/fieldtrack"; message TestFieldTrack { option (go_annotation.track_field_use) = true; - optional int32 optional_int32 = 1; - optional int64 optional_int64 = 2; - optional uint32 optional_uint32 = 3; - optional uint64 optional_uint64 = 4; - optional sint32 optional_sint32 = 5; - optional sint64 optional_sint64 = 6; - optional fixed32 optional_fixed32 = 7; - optional fixed64 optional_fixed64 = 8; - optional sfixed32 optional_sfixed32 = 9; + optional int32 optional_int32 = 1; + optional int64 optional_int64 = 2; + optional uint32 optional_uint32 = 3; + optional uint64 optional_uint64 = 4; + optional sint32 optional_sint32 = 5; + optional sint64 optional_sint64 = 6; + optional fixed32 optional_fixed32 = 7; + optional fixed64 optional_fixed64 = 8; + optional sfixed32 optional_sfixed32 = 9; optional sfixed64 optional_sfixed64 = 10; - optional float optional_float = 11; - optional double optional_double = 12; - optional bool optional_bool = 13; - optional string optional_string = 14; - optional bytes optional_bytes = 15; - optional goproto.proto.test.TestAllTypes.NestedEnum optional_enum = 16; + optional float optional_float = 11; + optional double optional_double = 12; + optional bool optional_bool = 13; + optional string optional_string = 14; + optional bytes optional_bytes = 15; + optional goproto.proto.test.TestAllTypes.NestedEnum optional_enum = 16; optional goproto.proto.test.TestAllTypes.NestedMessage optional_message = 17; - repeated int32 repeated_int32 = 21; - repeated int64 repeated_int64 = 22; - repeated uint32 repeated_uint32 = 23; - repeated uint64 repeated_uint64 = 24; - repeated sint32 repeated_sint32 = 25; - repeated sint64 repeated_sint64 = 26; - repeated fixed32 repeated_fixed32 = 27; - repeated fixed64 repeated_fixed64 = 28; + repeated int32 repeated_int32 = 21; + repeated int64 repeated_int64 = 22; + repeated uint32 repeated_uint32 = 23; + repeated uint64 repeated_uint64 = 24; + repeated sint32 repeated_sint32 = 25; + repeated sint64 repeated_sint64 = 26; + repeated fixed32 repeated_fixed32 = 27; + repeated fixed64 repeated_fixed64 = 28; repeated sfixed32 repeated_sfixed32 = 29; repeated sfixed64 repeated_sfixed64 = 30; - repeated float repeated_float = 31; - repeated double repeated_double = 32; - repeated bool repeated_bool = 33; - repeated string repeated_string = 34; - repeated bytes repeated_bytes = 35; - repeated goproto.proto.test.TestAllTypes.NestedEnum repeated_enum = 36; + repeated float repeated_float = 31; + repeated double repeated_double = 32; + repeated bool repeated_bool = 33; + repeated string repeated_string = 34; + repeated bytes repeated_bytes = 35; + repeated goproto.proto.test.TestAllTypes.NestedEnum repeated_enum = 36; repeated goproto.proto.test.TestAllTypes.NestedMessage repeated_message = 37; - map <string, int32> map_string_int32 = 41; - map <string, int64> map_string_int64 = 42; - map <string, uint32> map_string_uint32 = 43; - map <string, uint64> map_string_uint64 = 44; - map <string, sint32> map_string_sint32 = 45; - map <string, sint64> map_string_sint64 = 46; - map <string, fixed32> map_string_fixed32 = 47; - map <string, fixed64> map_string_fixed64 = 48; - map <string, sfixed32> map_string_sfixed32 = 49; - map <string, sfixed64> map_string_sfixed64 = 50; - map <string, float> map_string_float = 51; - map <string, double> map_string_double = 52; - map <string, bool> map_string_bool = 53; - map <string, string> map_string_string = 54; - map <string, bytes> map_string_bytes = 55; - map <string, goproto.proto.test.TestAllTypes.NestedEnum> map_string_enum = 56; - map <string, goproto.proto.test.TestAllTypes.NestedMessage> map_string_message = 57; + map<string, int32> map_string_int32 = 41; + map<string, int64> map_string_int64 = 42; + map<string, uint32> map_string_uint32 = 43; + map<string, uint64> map_string_uint64 = 44; + map<string, sint32> map_string_sint32 = 45; + map<string, sint64> map_string_sint64 = 46; + map<string, fixed32> map_string_fixed32 = 47; + map<string, fixed64> map_string_fixed64 = 48; + map<string, sfixed32> map_string_sfixed32 = 49; + map<string, sfixed64> map_string_sfixed64 = 50; + map<string, float> map_string_float = 51; + map<string, double> map_string_double = 52; + map<string, bool> map_string_bool = 53; + map<string, string> map_string_string = 54; + map<string, bytes> map_string_bytes = 55; + map<string, goproto.proto.test.TestAllTypes.NestedEnum> map_string_enum = 56; + map<string, goproto.proto.test.TestAllTypes.NestedMessage> + map_string_message = 57; - optional goproto.proto.test.weak.WeakImportMessage1 weak_message1 = 100 [weak=true]; - optional goproto.proto.test.weak.WeakImportMessage2 weak_message2 = 101 [weak=true]; + optional goproto.proto.test.weak.WeakImportMessage1 weak_message1 = 100 + [weak = true]; + optional goproto.proto.test.weak.WeakImportMessage2 weak_message2 = 101 + [weak = true]; } diff --git a/internal/testprotos/fuzz/fuzz.pb.go b/internal/testprotos/fuzz/fuzz.pb.go index e677f97f..29d75089 100644 --- a/internal/testprotos/fuzz/fuzz.pb.go +++ b/internal/testprotos/fuzz/fuzz.pb.go @@ -16,7 +16,8 @@ import ( sync "sync" ) -// Fuzz is a container for every message we want to make available to the fuzzer. +// Fuzz is a container for every message we want to make available to the +// fuzzer. type Fuzz struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/internal/testprotos/fuzz/fuzz.proto b/internal/testprotos/fuzz/fuzz.proto index 3b3ffe1d..8a4d06a6 100644 --- a/internal/testprotos/fuzz/fuzz.proto +++ b/internal/testprotos/fuzz/fuzz.proto @@ -11,13 +11,15 @@ import "internal/testprotos/test3/test.proto"; option go_package = "google.golang.org/protobuf/internal/testprotos/fuzz"; -// Fuzz is a container for every message we want to make available to the fuzzer. +// Fuzz is a container for every message we want to make available to the +// fuzzer. message Fuzz { optional goproto.proto.test.TestAllTypes test_all_types = 1; optional goproto.proto.test.TestAllExtensions test_all_extensions = 2; optional goproto.proto.test.TestRequired test_required = 3; optional goproto.proto.test.TestRequiredForeign test_required_foreign = 4; - optional goproto.proto.test.TestRequiredGroupFields test_required_group_fields = 5; + optional goproto.proto.test.TestRequiredGroupFields + test_required_group_fields = 5; optional goproto.proto.test.TestPackedTypes test_packed_types = 6; optional goproto.proto.test.TestPackedExtensions test_packed_extensions = 7; optional goproto.proto.test3.TestAllTypes test_all_types3 = 8; diff --git a/internal/testprotos/irregular/irregular.proto b/internal/testprotos/irregular/irregular.proto index 949316b0..9675aa5c 100644 --- a/internal/testprotos/irregular/irregular.proto +++ b/internal/testprotos/irregular/irregular.proto @@ -14,6 +14,6 @@ message IrregularMessage { optional string s = 1; } -// AberrantMessage is a message with an implementation with a non-struct underlying type. -message AberrantMessage { -} +// AberrantMessage is a message with an implementation with a non-struct +// underlying type. +message AberrantMessage {} diff --git a/internal/testprotos/irregular/test.proto b/internal/testprotos/irregular/test.proto index b128f7e6..af8c59d4 100644 --- a/internal/testprotos/irregular/test.proto +++ b/internal/testprotos/irregular/test.proto @@ -18,7 +18,7 @@ message Message { optional IrregularMessage optional_message = 1; repeated IrregularMessage repeated_message = 2; required IrregularMessage required_message = 3; - map<string,IrregularMessage> map_message = 4; + map<string, IrregularMessage> map_message = 4; oneof union { IrregularMessage oneof_message = 5; AberrantMessage oneof_aberrant_message = 6; @@ -27,5 +27,5 @@ message Message { optional AberrantMessage optional_aberrant_message = 7; repeated AberrantMessage repeated_aberrant_message = 8; required AberrantMessage required_aberrant_message = 9; - map<string,AberrantMessage> map_aberrant_message = 10; + map<string, AberrantMessage> map_aberrant_message = 10; } diff --git a/internal/testprotos/legacy/bug1052/bug1052.proto b/internal/testprotos/legacy/bug1052/bug1052.proto index adcb118a..a84562a2 100644 --- a/internal/testprotos/legacy/bug1052/bug1052.proto +++ b/internal/testprotos/legacy/bug1052/bug1052.proto @@ -23,4 +23,3 @@ enum Enum { extend google.protobuf.MethodOptions { optional Enum extension_enum = 5000; } - diff --git a/internal/testprotos/legacy/legacy.proto b/internal/testprotos/legacy/legacy.proto index 7f59ebca..c316eb11 100644 --- a/internal/testprotos/legacy/legacy.proto +++ b/internal/testprotos/legacy/legacy.proto @@ -5,6 +5,7 @@ syntax = "proto3"; package google.golang.org; + option go_package = "google.golang.org/protobuf/internal/testprotos/legacy"; // This file imports other files generated from a build of protoc-gen-go @@ -14,63 +15,69 @@ option go_package = "google.golang.org/protobuf/internal/testprotos/legacy"; // As such, there should never be a need to update these generated files. // // The specific version of protoc-gen-go used is encoded in the file path: -// ${NAME}_${COMMIT_DATE}_${COMMIT_HASH}/test.proto +// ${NAME}_${COMMIT_DATE}_${COMMIT_HASH}/test.proto // // To avoid a dependency on the v1 module, we perform the following // import path replacement to all generated .pb.go files: -// "github.com/golang/protobuf/proto" => "google.golang.org/protobuf/internal/protolegacy" +// "github.com/golang/protobuf/proto" => +// "google.golang.org/protobuf/internal/protolegacy" // The oldest supported version of protoc-gen-go is 2fc053c5, // which finished adding descriptor methods to all protobuf types. import "internal/testprotos/legacy/proto2_20160225_2fc053c5/test.proto"; // v0.0.0 import "internal/testprotos/legacy/proto3_20160225_2fc053c5/test.proto"; // v0.0.0 + // Changes from 20160225 to 20160519: -// * Nothing noteworthy to generated code +// * Nothing noteworthy to generated code import "internal/testprotos/legacy/proto2_20160519_a4ab9ec5/test.proto"; // v0.0.0 import "internal/testprotos/legacy/proto3_20160519_a4ab9ec5/test.proto"; // v0.0.0 + // Changes from 20160519 to 20180125: -// * Removed ExtensionMap method and XXX_extensions field from messages -// * Added embedded proto.XXX_InternalExtensions field to messages -// * Added proto.ExtensionDesc.Filename field -// * Added registration for file descriptor -// * Added Get accessor methods for all fields in proto3 messages -// * Proto3 repeated primitives are packed by default +// * Removed ExtensionMap method and XXX_extensions field from messages +// * Added embedded proto.XXX_InternalExtensions field to messages +// * Added proto.ExtensionDesc.Filename field +// * Added registration for file descriptor +// * Added Get accessor methods for all fields in proto3 messages +// * Proto3 repeated primitives are packed by default import "internal/testprotos/legacy/proto2_20180125_92554152/test.proto"; // v1.0.0 import "internal/testprotos/legacy/proto3_20180125_92554152/test.proto"; // v1.0.0 + // Changes from 20180125 to 20180430: -// * Added XXX_unrecognized field to proto3 messages -// * Added XXX_NoUnkeyedLiteral field to messages -// * Added XXX_sizecache field to messages -// * Added XXX_Unmarshal method to messages -// * Added XXX_Marshal method to messages -// * Added XXX_Merge method to messages -// * Added XXX_Size method to messages -// * Added XXX_DiscardUnknown method to messages -// * Added dependency on proto.InternalMessageInfo for table-driven logic -// * Added registration for map types +// * Added XXX_unrecognized field to proto3 messages +// * Added XXX_NoUnkeyedLiteral field to messages +// * Added XXX_sizecache field to messages +// * Added XXX_Unmarshal method to messages +// * Added XXX_Marshal method to messages +// * Added XXX_Merge method to messages +// * Added XXX_Size method to messages +// * Added XXX_DiscardUnknown method to messages +// * Added dependency on proto.InternalMessageInfo for table-driven logic +// * Added registration for map types import "internal/testprotos/legacy/proto2_20180430_b4deda09/test.proto"; // v1.1.0 import "internal/testprotos/legacy/proto3_20180430_b4deda09/test.proto"; // v1.1.0 + // Changes from 20180430 to 20180814: -// * Added "proto3" struct tag to all fields in proto3 messages +// * Added "proto3" struct tag to all fields in proto3 messages import "internal/testprotos/legacy/proto2_20180814_aa810b61/test.proto"; // v1.2.0 import "internal/testprotos/legacy/proto3_20180814_aa810b61/test.proto"; // v1.2.0 + // Changes from 20180814 to 20190205: -// * Changed the XXX_OneofFuncs method to XXX_OneofWrappers -// * Various syntactical changes to make the output more consistent +// * Changed the XXX_OneofFuncs method to XXX_OneofWrappers +// * Various syntactical changes to make the output more consistent import "internal/testprotos/legacy/proto2_20190205_c823c79e/test.proto"; // v1.3.0 import "internal/testprotos/legacy/proto3_20190205_c823c79e/test.proto"; // v1.3.0 message Legacy { - google.golang.org.proto2_20160225.Message f1 = 1; - google.golang.org.proto3_20160225.Message f2 = 2; - google.golang.org.proto2_20160519.Message f3 = 3; - google.golang.org.proto3_20160519.Message f4 = 4; - google.golang.org.proto2_20180125.Message f5 = 5; - google.golang.org.proto3_20180125.Message f6 = 6; - google.golang.org.proto2_20180430.Message f7 = 7; - google.golang.org.proto3_20180430.Message f8 = 8; - google.golang.org.proto2_20180814.Message f9 = 9; - google.golang.org.proto3_20180814.Message f10 = 10; - google.golang.org.proto2_20190205.Message f11 = 11; - google.golang.org.proto3_20190205.Message f12 = 12; + google.golang.org.proto2_20160225.Message f1 = 1; + google.golang.org.proto3_20160225.Message f2 = 2; + google.golang.org.proto2_20160519.Message f3 = 3; + google.golang.org.proto3_20160519.Message f4 = 4; + google.golang.org.proto2_20180125.Message f5 = 5; + google.golang.org.proto3_20180125.Message f6 = 6; + google.golang.org.proto2_20180430.Message f7 = 7; + google.golang.org.proto3_20180430.Message f8 = 8; + google.golang.org.proto2_20180814.Message f9 = 9; + google.golang.org.proto3_20180814.Message f10 = 10; + google.golang.org.proto2_20190205.Message f11 = 11; + google.golang.org.proto3_20190205.Message f12 = 12; } diff --git a/internal/testprotos/legacy/proto2_20160225_2fc053c5/test.proto b/internal/testprotos/legacy/proto2_20160225_2fc053c5/test.proto index 56025e18..48c6e73d 100644 --- a/internal/testprotos/legacy/proto2_20160225_2fc053c5/test.proto +++ b/internal/testprotos/legacy/proto2_20160225_2fc053c5/test.proto @@ -5,329 +5,336 @@ syntax = "proto2"; package google.golang.org.proto2_20160225; + option go_package = "google.golang.org/protobuf/internal/testprotos/legacy/proto2_20160225_2fc053c5"; enum SiblingEnum { - ALPHA = 0; - BRAVO = 10; - CHARLIE = 200; + ALPHA = 0; + BRAVO = 10; + CHARLIE = 200; } message SiblingMessage { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; } message Message { - enum ChildEnum { - ALPHA = 0; - BRAVO = 1; - CHARLIE = 2; - } - message ChildMessage { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; - } - optional group NamedGroup = 1 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; - } + enum ChildEnum { + ALPHA = 0; + BRAVO = 1; + CHARLIE = 2; + } + message ChildMessage { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; + } + optional group NamedGroup = 1 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; + } - // Optional fields. - optional bool optional_bool = 100; - optional int32 optional_int32 = 101; - optional sint32 optional_sint32 = 102; - optional uint32 optional_uint32 = 103; - optional int64 optional_int64 = 104; - optional sint64 optional_sint64 = 105; - optional uint64 optional_uint64 = 106; - optional fixed32 optional_fixed32 = 107; - optional sfixed32 optional_sfixed32 = 108; - optional float optional_float = 109; - optional fixed64 optional_fixed64 = 110; - optional sfixed64 optional_sfixed64 = 111; - optional double optional_double = 112; - optional string optional_string = 113; - optional bytes optional_bytes = 114; + // Optional fields. + optional bool optional_bool = 100; + optional int32 optional_int32 = 101; + optional sint32 optional_sint32 = 102; + optional uint32 optional_uint32 = 103; + optional int64 optional_int64 = 104; + optional sint64 optional_sint64 = 105; + optional uint64 optional_uint64 = 106; + optional fixed32 optional_fixed32 = 107; + optional sfixed32 optional_sfixed32 = 108; + optional float optional_float = 109; + optional fixed64 optional_fixed64 = 110; + optional sfixed64 optional_sfixed64 = 111; + optional double optional_double = 112; + optional string optional_string = 113; + optional bytes optional_bytes = 114; - optional ChildEnum optional_child_enum = 115; - optional ChildMessage optional_child_message = 116; - optional NamedGroup optional_named_group = 117; - optional SiblingEnum optional_sibling_enum = 118; - optional SiblingMessage optional_sibling_message = 119; - optional group OptionalGroup = 120 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + optional ChildEnum optional_child_enum = 115; + optional ChildMessage optional_child_message = 116; + optional NamedGroup optional_named_group = 117; + optional SiblingEnum optional_sibling_enum = 118; + optional SiblingMessage optional_sibling_message = 119; + optional group OptionalGroup = 120 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Optional default fields. - optional bool defaulted_bool = 200 [default = true]; - optional int32 defaulted_int32 = 201 [default = -12345]; - optional sint32 defaulted_sint32 = 202 [default = -3200]; - optional uint32 defaulted_uint32 = 203 [default = 3200]; - optional int64 defaulted_int64 = 204 [default = -123456789]; - optional sint64 defaulted_sint64 = 205 [default = -6400]; - optional uint64 defaulted_uint64 = 206 [default = 6400]; - optional fixed32 defaulted_fixed32 = 207 [default = 320000]; - optional sfixed32 defaulted_sfixed32 = 208 [default = -320000]; - optional float defaulted_float = 209 [default = 3.14159]; - optional fixed64 defaulted_fixed64 = 210 [default = 640000]; - optional sfixed64 defaulted_sfixed64 = 211 [default = -640000]; - optional double defaulted_double = 212 [default = 3.14159265359]; - optional string defaulted_string = 213 [default = "hello, \"world!\"\n"]; - optional bytes defaulted_bytes = 214 [default = "dead\xde\xad\xbe\xefbeef"]; + // Optional default fields. + optional bool defaulted_bool = 200 [default = true]; + optional int32 defaulted_int32 = 201 [default = -12345]; + optional sint32 defaulted_sint32 = 202 [default = -3200]; + optional uint32 defaulted_uint32 = 203 [default = 3200]; + optional int64 defaulted_int64 = 204 [default = -123456789]; + optional sint64 defaulted_sint64 = 205 [default = -6400]; + optional uint64 defaulted_uint64 = 206 [default = 6400]; + optional fixed32 defaulted_fixed32 = 207 [default = 320000]; + optional sfixed32 defaulted_sfixed32 = 208 [default = -320000]; + optional float defaulted_float = 209 [default = 3.14159]; + optional fixed64 defaulted_fixed64 = 210 [default = 640000]; + optional sfixed64 defaulted_sfixed64 = 211 [default = -640000]; + optional double defaulted_double = 212 [default = 3.14159265359]; + optional string defaulted_string = 213 [default = "hello, \"world!\"\n"]; + optional bytes defaulted_bytes = 214 [default = "dead\xde\xad\xbe\xefbeef"]; - optional ChildEnum defaulted_child_enum = 215 [default = ALPHA]; - optional SiblingEnum defaulted_sibling_enum = 216 [default = ALPHA]; + optional ChildEnum defaulted_child_enum = 215 [default = ALPHA]; + optional SiblingEnum defaulted_sibling_enum = 216 [default = ALPHA]; - // Required fields. - required bool required_bool = 300; - required int32 required_int32 = 301; - required sint32 required_sint32 = 302; - required uint32 required_uint32 = 303; - required int64 required_int64 = 304; - required sint64 required_sint64 = 305; - required uint64 required_uint64 = 306; - required fixed32 required_fixed32 = 307; - required sfixed32 required_sfixed32 = 308; - required float required_float = 309; - required fixed64 required_fixed64 = 310; - required sfixed64 required_sfixed64 = 311; - required double required_double = 312; - required string required_string = 313; - required bytes required_bytes = 314; + // Required fields. + required bool required_bool = 300; + required int32 required_int32 = 301; + required sint32 required_sint32 = 302; + required uint32 required_uint32 = 303; + required int64 required_int64 = 304; + required sint64 required_sint64 = 305; + required uint64 required_uint64 = 306; + required fixed32 required_fixed32 = 307; + required sfixed32 required_sfixed32 = 308; + required float required_float = 309; + required fixed64 required_fixed64 = 310; + required sfixed64 required_sfixed64 = 311; + required double required_double = 312; + required string required_string = 313; + required bytes required_bytes = 314; - required ChildEnum required_child_enum = 315; - required ChildMessage required_child_message = 316; - required NamedGroup required_named_group = 317; - required SiblingEnum required_sibling_enum = 318; - required SiblingMessage required_sibling_message = 319; - required group RequiredGroup = 320 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } - // Required default fields. - required bool required_defaulted_bool = 400 [default = true]; - required int32 required_defaulted_int32 = 401 [default = -12345]; - required sint32 required_defaulted_sint32 = 402 [default = -3200]; - required uint32 required_defaulted_uint32 = 403 [default = 3200]; - required int64 required_defaulted_int64 = 404 [default = -123456789]; - required sint64 required_defaulted_sint64 = 405 [default = -6400]; - required uint64 required_defaulted_uint64 = 406 [default = 6400]; - required fixed32 required_defaulted_fixed32 = 407 [default = 320000]; - required sfixed32 required_defaulted_sfixed32 = 408 [default = -320000]; - required float required_defaulted_float = 409 [default = 3.14159]; - required fixed64 required_defaulted_fixed64 = 410 [default = 640000]; - required sfixed64 required_defaulted_sfixed64 = 411 [default = -640000]; - required double required_defaulted_double = 412 [default = 3.14159265359]; - required string required_defaulted_string = 413 [default = "hello, \"world!\"\n"]; - required bytes required_defaulted_bytes = 414 [default = "dead\xde\xad\xbe\xefbeef"]; + required ChildEnum required_child_enum = 315; + required ChildMessage required_child_message = 316; + required NamedGroup required_named_group = 317; + required SiblingEnum required_sibling_enum = 318; + required SiblingMessage required_sibling_message = 319; + required group RequiredGroup = 320 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } + // Required default fields. + required bool required_defaulted_bool = 400 [default = true]; + required int32 required_defaulted_int32 = 401 [default = -12345]; + required sint32 required_defaulted_sint32 = 402 [default = -3200]; + required uint32 required_defaulted_uint32 = 403 [default = 3200]; + required int64 required_defaulted_int64 = 404 [default = -123456789]; + required sint64 required_defaulted_sint64 = 405 [default = -6400]; + required uint64 required_defaulted_uint64 = 406 [default = 6400]; + required fixed32 required_defaulted_fixed32 = 407 [default = 320000]; + required sfixed32 required_defaulted_sfixed32 = 408 [default = -320000]; + required float required_defaulted_float = 409 [default = 3.14159]; + required fixed64 required_defaulted_fixed64 = 410 [default = 640000]; + required sfixed64 required_defaulted_sfixed64 = 411 [default = -640000]; + required double required_defaulted_double = 412 [default = 3.14159265359]; + required string required_defaulted_string = 413 + [default = "hello, \"world!\"\n"]; + required bytes required_defaulted_bytes = 414 + [default = "dead\xde\xad\xbe\xefbeef"]; - required ChildEnum required_defaulted_child_enum = 415 [default = ALPHA]; - required SiblingEnum required_defaulted_sibling_enum = 416 [default = ALPHA]; + required ChildEnum required_defaulted_child_enum = 415 [default = ALPHA]; + required SiblingEnum required_defaulted_sibling_enum = 416 [default = ALPHA]; - // Repeated fields. - repeated bool repeated_bool = 500; - repeated int32 repeated_int32 = 501; - repeated sint32 repeated_sint32 = 502; - repeated uint32 repeated_uint32 = 503; - repeated int64 repeated_int64 = 504; - repeated sint64 repeated_sint64 = 505; - repeated uint64 repeated_uint64 = 506; - repeated fixed32 repeated_fixed32 = 507; - repeated sfixed32 repeated_sfixed32 = 508; - repeated float repeated_float = 509; - repeated fixed64 repeated_fixed64 = 510; - repeated sfixed64 repeated_sfixed64 = 511; - repeated double repeated_double = 512; - repeated string repeated_string = 513; - repeated bytes repeated_bytes = 514; + // Repeated fields. + repeated bool repeated_bool = 500; + repeated int32 repeated_int32 = 501; + repeated sint32 repeated_sint32 = 502; + repeated uint32 repeated_uint32 = 503; + repeated int64 repeated_int64 = 504; + repeated sint64 repeated_sint64 = 505; + repeated uint64 repeated_uint64 = 506; + repeated fixed32 repeated_fixed32 = 507; + repeated sfixed32 repeated_sfixed32 = 508; + repeated float repeated_float = 509; + repeated fixed64 repeated_fixed64 = 510; + repeated sfixed64 repeated_sfixed64 = 511; + repeated double repeated_double = 512; + repeated string repeated_string = 513; + repeated bytes repeated_bytes = 514; - repeated ChildEnum repeated_child_enum = 515; - repeated ChildMessage repeated_child_message = 516; - repeated NamedGroup repeated_named_group = 517; - repeated SiblingEnum repeated_sibling_enum = 518; - repeated SiblingMessage repeated_sibling_message = 519; - repeated group RepeatedGroup = 520 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + repeated ChildEnum repeated_child_enum = 515; + repeated ChildMessage repeated_child_message = 516; + repeated NamedGroup repeated_named_group = 517; + repeated SiblingEnum repeated_sibling_enum = 518; + repeated SiblingMessage repeated_sibling_message = 519; + repeated group RepeatedGroup = 520 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Map fields. - map<bool, bool> map_bool_bool = 600; - map<bool, int32> map_bool_int32 = 601; - map<bool, sint32> map_bool_sint32 = 602; - map<bool, uint32> map_bool_uint32 = 603; - map<bool, int64> map_bool_int64 = 604; - map<bool, sint64> map_bool_sint64 = 605; - map<bool, uint64> map_bool_uint64 = 606; - map<bool, fixed32> map_bool_fixed32 = 607; - map<bool, sfixed32> map_bool_sfixed32 = 608; - map<bool, float> map_bool_float = 609; - map<bool, fixed64> map_bool_fixed64 = 610; - map<bool, sfixed64> map_bool_sfixed64 = 611; - map<bool, double> map_bool_double = 612; - map<bool, string> map_bool_string = 613; - map<bool, bytes> map_bool_bytes = 614; + // Map fields. + map<bool, bool> map_bool_bool = 600; + map<bool, int32> map_bool_int32 = 601; + map<bool, sint32> map_bool_sint32 = 602; + map<bool, uint32> map_bool_uint32 = 603; + map<bool, int64> map_bool_int64 = 604; + map<bool, sint64> map_bool_sint64 = 605; + map<bool, uint64> map_bool_uint64 = 606; + map<bool, fixed32> map_bool_fixed32 = 607; + map<bool, sfixed32> map_bool_sfixed32 = 608; + map<bool, float> map_bool_float = 609; + map<bool, fixed64> map_bool_fixed64 = 610; + map<bool, sfixed64> map_bool_sfixed64 = 611; + map<bool, double> map_bool_double = 612; + map<bool, string> map_bool_string = 613; + map<bool, bytes> map_bool_bytes = 614; - map<bool, ChildEnum> map_bool_child_enum = 615; - map<bool, ChildMessage> map_bool_child_message = 616; - map<bool, NamedGroup> map_bool_named_group = 617; - map<bool, SiblingEnum> map_bool_sibling_enum = 618; - map<bool, SiblingMessage> map_bool_sibling_message = 619; + map<bool, ChildEnum> map_bool_child_enum = 615; + map<bool, ChildMessage> map_bool_child_message = 616; + map<bool, NamedGroup> map_bool_named_group = 617; + map<bool, SiblingEnum> map_bool_sibling_enum = 618; + map<bool, SiblingMessage> map_bool_sibling_message = 619; - map<int32, bool> map_int32_bool = 620; - map<sint32, bool> map_sint32_bool = 621; - map<uint32, bool> map_uint32_bool = 622; - map<int64, bool> map_int64_bool = 623; - map<sint64, bool> map_sint64_bool = 624; - map<uint64, bool> map_uint64_bool = 625; - map<fixed32, bool> map_fixed32_bool = 626; - map<string, bool> map_string_bool = 627; + map<int32, bool> map_int32_bool = 620; + map<sint32, bool> map_sint32_bool = 621; + map<uint32, bool> map_uint32_bool = 622; + map<int64, bool> map_int64_bool = 623; + map<sint64, bool> map_sint64_bool = 624; + map<uint64, bool> map_uint64_bool = 625; + map<fixed32, bool> map_fixed32_bool = 626; + map<string, bool> map_string_bool = 627; - // Oneof fields. - oneof oneof_union { - bool oneof_bool = 700; - int32 oneof_int32 = 701; - sint32 oneof_sint32 = 702; - uint32 oneof_uint32 = 703; - int64 oneof_int64 = 704; - sint64 oneof_sint64 = 705; - uint64 oneof_uint64 = 706; - fixed32 oneof_fixed32 = 707; - sfixed32 oneof_sfixed32 = 708; - float oneof_float = 709; - fixed64 oneof_fixed64 = 710; - sfixed64 oneof_sfixed64 = 711; - double oneof_double = 712; - string oneof_string = 713; - bytes oneof_bytes = 714; + // Oneof fields. + oneof oneof_union { + bool oneof_bool = 700; + int32 oneof_int32 = 701; + sint32 oneof_sint32 = 702; + uint32 oneof_uint32 = 703; + int64 oneof_int64 = 704; + sint64 oneof_sint64 = 705; + uint64 oneof_uint64 = 706; + fixed32 oneof_fixed32 = 707; + sfixed32 oneof_sfixed32 = 708; + float oneof_float = 709; + fixed64 oneof_fixed64 = 710; + sfixed64 oneof_sfixed64 = 711; + double oneof_double = 712; + string oneof_string = 713; + bytes oneof_bytes = 714; - ChildEnum oneof_child_enum = 715; - ChildMessage oneof_child_message = 716; - NamedGroup oneof_named_group = 717; - SiblingEnum oneof_sibling_enum = 718; - SiblingMessage oneof_sibling_message = 719; - group OneofGroup = 720 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + ChildEnum oneof_child_enum = 715; + ChildMessage oneof_child_message = 716; + NamedGroup oneof_named_group = 717; + SiblingEnum oneof_sibling_enum = 718; + SiblingMessage oneof_sibling_message = 719; + group OneofGroup = 720 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - string oneof_string1 = 721; - string oneof_string2 = 722; - string oneof_string3 = 723; - } + string oneof_string1 = 721; + string oneof_string2 = 722; + string oneof_string3 = 723; + } - // Oneof default fields. - oneof oneof_defaulted_union { - bool oneof_defaulted_bool = 800 [default = true]; - int32 oneof_defaulted_int32 = 801 [default = -12345]; - sint32 oneof_defaulted_sint32 = 802 [default = -3200]; - uint32 oneof_defaulted_uint32 = 803 [default = 3200]; - int64 oneof_defaulted_int64 = 804 [default = -123456789]; - sint64 oneof_defaulted_sint64 = 805 [default = -6400]; - uint64 oneof_defaulted_uint64 = 806 [default = 6400]; - fixed32 oneof_defaulted_fixed32 = 807 [default = 320000]; - sfixed32 oneof_defaulted_sfixed32 = 808 [default = -320000]; - float oneof_defaulted_float = 809 [default = 3.14159]; - fixed64 oneof_defaulted_fixed64 = 810 [default = 640000]; - sfixed64 oneof_defaulted_sfixed64 = 811 [default = -640000]; - double oneof_defaulted_double = 812 [default = 3.14159265359]; - string oneof_defaulted_string = 813 [default = "hello, \"world!\"\n"]; - bytes oneof_defaulted_bytes = 814 [default = "dead\xde\xad\xbe\xefbeef"]; + // Oneof default fields. + oneof oneof_defaulted_union { + bool oneof_defaulted_bool = 800 [default = true]; + int32 oneof_defaulted_int32 = 801 [default = -12345]; + sint32 oneof_defaulted_sint32 = 802 [default = -3200]; + uint32 oneof_defaulted_uint32 = 803 [default = 3200]; + int64 oneof_defaulted_int64 = 804 [default = -123456789]; + sint64 oneof_defaulted_sint64 = 805 [default = -6400]; + uint64 oneof_defaulted_uint64 = 806 [default = 6400]; + fixed32 oneof_defaulted_fixed32 = 807 [default = 320000]; + sfixed32 oneof_defaulted_sfixed32 = 808 [default = -320000]; + float oneof_defaulted_float = 809 [default = 3.14159]; + fixed64 oneof_defaulted_fixed64 = 810 [default = 640000]; + sfixed64 oneof_defaulted_sfixed64 = 811 [default = -640000]; + double oneof_defaulted_double = 812 [default = 3.14159265359]; + string oneof_defaulted_string = 813 [default = "hello, \"world!\"\n"]; + bytes oneof_defaulted_bytes = 814 [default = "dead\xde\xad\xbe\xefbeef"]; - ChildEnum oneof_defaulted_child_enum = 815 [default = ALPHA]; - SiblingEnum oneof_defaulted_sibling_enum = 816 [default = ALPHA]; - } + ChildEnum oneof_defaulted_child_enum = 815 [default = ALPHA]; + SiblingEnum oneof_defaulted_sibling_enum = 816 [default = ALPHA]; + } - // Extension fields. - extend Message { - // Optional fields. - optional bool extension_optional_bool = 10000; - optional int32 extension_optional_int32 = 10001; - optional sint32 extension_optional_sint32 = 10002; - optional uint32 extension_optional_uint32 = 10003; - optional int64 extension_optional_int64 = 10004; - optional sint64 extension_optional_sint64 = 10005; - optional uint64 extension_optional_uint64 = 10006; - optional fixed32 extension_optional_fixed32 = 10007; - optional sfixed32 extension_optional_sfixed32 = 10008; - optional float extension_optional_float = 10009; - optional fixed64 extension_optional_fixed64 = 10010; - optional sfixed64 extension_optional_sfixed64 = 10011; - optional double extension_optional_double = 10012; - optional string extension_optional_string = 10013; - optional bytes extension_optional_bytes = 10014; + // Extension fields. + extend Message { + // Optional fields. + optional bool extension_optional_bool = 10000; + optional int32 extension_optional_int32 = 10001; + optional sint32 extension_optional_sint32 = 10002; + optional uint32 extension_optional_uint32 = 10003; + optional int64 extension_optional_int64 = 10004; + optional sint64 extension_optional_sint64 = 10005; + optional uint64 extension_optional_uint64 = 10006; + optional fixed32 extension_optional_fixed32 = 10007; + optional sfixed32 extension_optional_sfixed32 = 10008; + optional float extension_optional_float = 10009; + optional fixed64 extension_optional_fixed64 = 10010; + optional sfixed64 extension_optional_sfixed64 = 10011; + optional double extension_optional_double = 10012; + optional string extension_optional_string = 10013; + optional bytes extension_optional_bytes = 10014; - optional ChildEnum extension_optional_child_enum = 10015; - optional ChildMessage extension_optional_child_message = 10016; - optional NamedGroup extension_optional_named_group = 10017; - optional SiblingEnum extension_optional_sibling_enum = 10018; - optional SiblingMessage extension_optional_sibling_message = 10019; - optional group ExtensionOptionalGroup = 10020 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + optional ChildEnum extension_optional_child_enum = 10015; + optional ChildMessage extension_optional_child_message = 10016; + optional NamedGroup extension_optional_named_group = 10017; + optional SiblingEnum extension_optional_sibling_enum = 10018; + optional SiblingMessage extension_optional_sibling_message = 10019; + optional group ExtensionOptionalGroup = 10020 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Optional default fields. - optional bool extension_defaulted_bool = 20000 [default = true]; - optional int32 extension_defaulted_int32 = 20001 [default = -12345]; - optional sint32 extension_defaulted_sint32 = 20002 [default = -3200]; - optional uint32 extension_defaulted_uint32 = 20003 [default = 3200]; - optional int64 extension_defaulted_int64 = 20004 [default = -123456789]; - optional sint64 extension_defaulted_sint64 = 20005 [default = -6400]; - optional uint64 extension_defaulted_uint64 = 20006 [default = 6400]; - optional fixed32 extension_defaulted_fixed32 = 20007 [default = 320000]; - optional sfixed32 extension_defaulted_sfixed32 = 20008 [default = -320000]; - optional float extension_defaulted_float = 20009 [default = 3.14159]; - optional fixed64 extension_defaulted_fixed64 = 20010 [default = 640000]; - optional sfixed64 extension_defaulted_sfixed64 = 20011 [default = -640000]; - optional double extension_defaulted_double = 20012 [default = 3.14159265359]; - optional string extension_defaulted_string = 20013 [default = "hello, \"world!\"\n"]; - optional bytes extension_defaulted_bytes = 20014 [default = "dead\xde\xad\xbe\xefbeef"]; + // Optional default fields. + optional bool extension_defaulted_bool = 20000 [default = true]; + optional int32 extension_defaulted_int32 = 20001 [default = -12345]; + optional sint32 extension_defaulted_sint32 = 20002 [default = -3200]; + optional uint32 extension_defaulted_uint32 = 20003 [default = 3200]; + optional int64 extension_defaulted_int64 = 20004 [default = -123456789]; + optional sint64 extension_defaulted_sint64 = 20005 [default = -6400]; + optional uint64 extension_defaulted_uint64 = 20006 [default = 6400]; + optional fixed32 extension_defaulted_fixed32 = 20007 [default = 320000]; + optional sfixed32 extension_defaulted_sfixed32 = 20008 [default = -320000]; + optional float extension_defaulted_float = 20009 [default = 3.14159]; + optional fixed64 extension_defaulted_fixed64 = 20010 [default = 640000]; + optional sfixed64 extension_defaulted_sfixed64 = 20011 [default = -640000]; + optional double extension_defaulted_double = 20012 + [default = 3.14159265359]; + optional string extension_defaulted_string = 20013 + [default = "hello, \"world!\"\n"]; + optional bytes extension_defaulted_bytes = 20014 + [default = "dead\xde\xad\xbe\xefbeef"]; - optional ChildEnum extension_defaulted_child_enum = 20015 [default = ALPHA]; - optional SiblingEnum extension_defaulted_sibling_enum = 20016 [default = ALPHA]; + optional ChildEnum extension_defaulted_child_enum = 20015 [default = ALPHA]; + optional SiblingEnum extension_defaulted_sibling_enum = 20016 + [default = ALPHA]; - // Repeated fields. - repeated bool extension_repeated_bool = 30000; - repeated int32 extension_repeated_int32 = 30001; - repeated sint32 extension_repeated_sint32 = 30002; - repeated uint32 extension_repeated_uint32 = 30003; - repeated int64 extension_repeated_int64 = 30004; - repeated sint64 extension_repeated_sint64 = 30005; - repeated uint64 extension_repeated_uint64 = 30006; - repeated fixed32 extension_repeated_fixed32 = 30007; - repeated sfixed32 extension_repeated_sfixed32 = 30008; - repeated float extension_repeated_float = 30009; - repeated fixed64 extension_repeated_fixed64 = 30010; - repeated sfixed64 extension_repeated_sfixed64 = 30011; - repeated double extension_repeated_double = 30012; - repeated string extension_repeated_string = 30013; - repeated bytes extension_repeated_bytes = 30014; + // Repeated fields. + repeated bool extension_repeated_bool = 30000; + repeated int32 extension_repeated_int32 = 30001; + repeated sint32 extension_repeated_sint32 = 30002; + repeated uint32 extension_repeated_uint32 = 30003; + repeated int64 extension_repeated_int64 = 30004; + repeated sint64 extension_repeated_sint64 = 30005; + repeated uint64 extension_repeated_uint64 = 30006; + repeated fixed32 extension_repeated_fixed32 = 30007; + repeated sfixed32 extension_repeated_sfixed32 = 30008; + repeated float extension_repeated_float = 30009; + repeated fixed64 extension_repeated_fixed64 = 30010; + repeated sfixed64 extension_repeated_sfixed64 = 30011; + repeated double extension_repeated_double = 30012; + repeated string extension_repeated_string = 30013; + repeated bytes extension_repeated_bytes = 30014; - repeated ChildEnum extension_repeated_child_enum = 30015; - repeated ChildMessage extension_repeated_child_message = 30016; - repeated NamedGroup extension_repeated_named_group = 30017; - repeated SiblingEnum extension_repeated_sibling_enum = 30018; - repeated SiblingMessage extension_repeated_sibling_message = 30019; - repeated group ExtensionRepeatedGroup = 30020 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } - } + repeated ChildEnum extension_repeated_child_enum = 30015; + repeated ChildMessage extension_repeated_child_message = 30016; + repeated NamedGroup extension_repeated_named_group = 30017; + repeated SiblingEnum extension_repeated_sibling_enum = 30018; + repeated SiblingMessage extension_repeated_sibling_message = 30019; + repeated group ExtensionRepeatedGroup = 30020 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } + } - extensions 10000 to max; + extensions 10000 to max; } diff --git a/internal/testprotos/legacy/proto2_20160519_a4ab9ec5/test.proto b/internal/testprotos/legacy/proto2_20160519_a4ab9ec5/test.proto index e765d644..0157806e 100644 --- a/internal/testprotos/legacy/proto2_20160519_a4ab9ec5/test.proto +++ b/internal/testprotos/legacy/proto2_20160519_a4ab9ec5/test.proto @@ -5,329 +5,336 @@ syntax = "proto2"; package google.golang.org.proto2_20160519; + option go_package = "google.golang.org/protobuf/internal/testprotos/legacy/proto2_20160519_a4ab9ec5"; enum SiblingEnum { - ALPHA = 0; - BRAVO = 10; - CHARLIE = 200; + ALPHA = 0; + BRAVO = 10; + CHARLIE = 200; } message SiblingMessage { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; } message Message { - enum ChildEnum { - ALPHA = 0; - BRAVO = 1; - CHARLIE = 2; - } - message ChildMessage { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; - } - optional group NamedGroup = 1 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; - } + enum ChildEnum { + ALPHA = 0; + BRAVO = 1; + CHARLIE = 2; + } + message ChildMessage { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; + } + optional group NamedGroup = 1 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; + } - // Optional fields. - optional bool optional_bool = 100; - optional int32 optional_int32 = 101; - optional sint32 optional_sint32 = 102; - optional uint32 optional_uint32 = 103; - optional int64 optional_int64 = 104; - optional sint64 optional_sint64 = 105; - optional uint64 optional_uint64 = 106; - optional fixed32 optional_fixed32 = 107; - optional sfixed32 optional_sfixed32 = 108; - optional float optional_float = 109; - optional fixed64 optional_fixed64 = 110; - optional sfixed64 optional_sfixed64 = 111; - optional double optional_double = 112; - optional string optional_string = 113; - optional bytes optional_bytes = 114; + // Optional fields. + optional bool optional_bool = 100; + optional int32 optional_int32 = 101; + optional sint32 optional_sint32 = 102; + optional uint32 optional_uint32 = 103; + optional int64 optional_int64 = 104; + optional sint64 optional_sint64 = 105; + optional uint64 optional_uint64 = 106; + optional fixed32 optional_fixed32 = 107; + optional sfixed32 optional_sfixed32 = 108; + optional float optional_float = 109; + optional fixed64 optional_fixed64 = 110; + optional sfixed64 optional_sfixed64 = 111; + optional double optional_double = 112; + optional string optional_string = 113; + optional bytes optional_bytes = 114; - optional ChildEnum optional_child_enum = 115; - optional ChildMessage optional_child_message = 116; - optional NamedGroup optional_named_group = 117; - optional SiblingEnum optional_sibling_enum = 118; - optional SiblingMessage optional_sibling_message = 119; - optional group OptionalGroup = 120 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + optional ChildEnum optional_child_enum = 115; + optional ChildMessage optional_child_message = 116; + optional NamedGroup optional_named_group = 117; + optional SiblingEnum optional_sibling_enum = 118; + optional SiblingMessage optional_sibling_message = 119; + optional group OptionalGroup = 120 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Optional default fields. - optional bool defaulted_bool = 200 [default = true]; - optional int32 defaulted_int32 = 201 [default = -12345]; - optional sint32 defaulted_sint32 = 202 [default = -3200]; - optional uint32 defaulted_uint32 = 203 [default = 3200]; - optional int64 defaulted_int64 = 204 [default = -123456789]; - optional sint64 defaulted_sint64 = 205 [default = -6400]; - optional uint64 defaulted_uint64 = 206 [default = 6400]; - optional fixed32 defaulted_fixed32 = 207 [default = 320000]; - optional sfixed32 defaulted_sfixed32 = 208 [default = -320000]; - optional float defaulted_float = 209 [default = 3.14159]; - optional fixed64 defaulted_fixed64 = 210 [default = 640000]; - optional sfixed64 defaulted_sfixed64 = 211 [default = -640000]; - optional double defaulted_double = 212 [default = 3.14159265359]; - optional string defaulted_string = 213 [default = "hello, \"world!\"\n"]; - optional bytes defaulted_bytes = 214 [default = "dead\xde\xad\xbe\xefbeef"]; + // Optional default fields. + optional bool defaulted_bool = 200 [default = true]; + optional int32 defaulted_int32 = 201 [default = -12345]; + optional sint32 defaulted_sint32 = 202 [default = -3200]; + optional uint32 defaulted_uint32 = 203 [default = 3200]; + optional int64 defaulted_int64 = 204 [default = -123456789]; + optional sint64 defaulted_sint64 = 205 [default = -6400]; + optional uint64 defaulted_uint64 = 206 [default = 6400]; + optional fixed32 defaulted_fixed32 = 207 [default = 320000]; + optional sfixed32 defaulted_sfixed32 = 208 [default = -320000]; + optional float defaulted_float = 209 [default = 3.14159]; + optional fixed64 defaulted_fixed64 = 210 [default = 640000]; + optional sfixed64 defaulted_sfixed64 = 211 [default = -640000]; + optional double defaulted_double = 212 [default = 3.14159265359]; + optional string defaulted_string = 213 [default = "hello, \"world!\"\n"]; + optional bytes defaulted_bytes = 214 [default = "dead\xde\xad\xbe\xefbeef"]; - optional ChildEnum defaulted_child_enum = 215 [default = ALPHA]; - optional SiblingEnum defaulted_sibling_enum = 216 [default = ALPHA]; + optional ChildEnum defaulted_child_enum = 215 [default = ALPHA]; + optional SiblingEnum defaulted_sibling_enum = 216 [default = ALPHA]; - // Required fields. - required bool required_bool = 300; - required int32 required_int32 = 301; - required sint32 required_sint32 = 302; - required uint32 required_uint32 = 303; - required int64 required_int64 = 304; - required sint64 required_sint64 = 305; - required uint64 required_uint64 = 306; - required fixed32 required_fixed32 = 307; - required sfixed32 required_sfixed32 = 308; - required float required_float = 309; - required fixed64 required_fixed64 = 310; - required sfixed64 required_sfixed64 = 311; - required double required_double = 312; - required string required_string = 313; - required bytes required_bytes = 314; + // Required fields. + required bool required_bool = 300; + required int32 required_int32 = 301; + required sint32 required_sint32 = 302; + required uint32 required_uint32 = 303; + required int64 required_int64 = 304; + required sint64 required_sint64 = 305; + required uint64 required_uint64 = 306; + required fixed32 required_fixed32 = 307; + required sfixed32 required_sfixed32 = 308; + required float required_float = 309; + required fixed64 required_fixed64 = 310; + required sfixed64 required_sfixed64 = 311; + required double required_double = 312; + required string required_string = 313; + required bytes required_bytes = 314; - required ChildEnum required_child_enum = 315; - required ChildMessage required_child_message = 316; - required NamedGroup required_named_group = 317; - required SiblingEnum required_sibling_enum = 318; - required SiblingMessage required_sibling_message = 319; - required group RequiredGroup = 320 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } - // Required default fields. - required bool required_defaulted_bool = 400 [default = true]; - required int32 required_defaulted_int32 = 401 [default = -12345]; - required sint32 required_defaulted_sint32 = 402 [default = -3200]; - required uint32 required_defaulted_uint32 = 403 [default = 3200]; - required int64 required_defaulted_int64 = 404 [default = -123456789]; - required sint64 required_defaulted_sint64 = 405 [default = -6400]; - required uint64 required_defaulted_uint64 = 406 [default = 6400]; - required fixed32 required_defaulted_fixed32 = 407 [default = 320000]; - required sfixed32 required_defaulted_sfixed32 = 408 [default = -320000]; - required float required_defaulted_float = 409 [default = 3.14159]; - required fixed64 required_defaulted_fixed64 = 410 [default = 640000]; - required sfixed64 required_defaulted_sfixed64 = 411 [default = -640000]; - required double required_defaulted_double = 412 [default = 3.14159265359]; - required string required_defaulted_string = 413 [default = "hello, \"world!\"\n"]; - required bytes required_defaulted_bytes = 414 [default = "dead\xde\xad\xbe\xefbeef"]; + required ChildEnum required_child_enum = 315; + required ChildMessage required_child_message = 316; + required NamedGroup required_named_group = 317; + required SiblingEnum required_sibling_enum = 318; + required SiblingMessage required_sibling_message = 319; + required group RequiredGroup = 320 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } + // Required default fields. + required bool required_defaulted_bool = 400 [default = true]; + required int32 required_defaulted_int32 = 401 [default = -12345]; + required sint32 required_defaulted_sint32 = 402 [default = -3200]; + required uint32 required_defaulted_uint32 = 403 [default = 3200]; + required int64 required_defaulted_int64 = 404 [default = -123456789]; + required sint64 required_defaulted_sint64 = 405 [default = -6400]; + required uint64 required_defaulted_uint64 = 406 [default = 6400]; + required fixed32 required_defaulted_fixed32 = 407 [default = 320000]; + required sfixed32 required_defaulted_sfixed32 = 408 [default = -320000]; + required float required_defaulted_float = 409 [default = 3.14159]; + required fixed64 required_defaulted_fixed64 = 410 [default = 640000]; + required sfixed64 required_defaulted_sfixed64 = 411 [default = -640000]; + required double required_defaulted_double = 412 [default = 3.14159265359]; + required string required_defaulted_string = 413 + [default = "hello, \"world!\"\n"]; + required bytes required_defaulted_bytes = 414 + [default = "dead\xde\xad\xbe\xefbeef"]; - required ChildEnum required_defaulted_child_enum = 415 [default = ALPHA]; - required SiblingEnum required_defaulted_sibling_enum = 416 [default = ALPHA]; + required ChildEnum required_defaulted_child_enum = 415 [default = ALPHA]; + required SiblingEnum required_defaulted_sibling_enum = 416 [default = ALPHA]; - // Repeated fields. - repeated bool repeated_bool = 500; - repeated int32 repeated_int32 = 501; - repeated sint32 repeated_sint32 = 502; - repeated uint32 repeated_uint32 = 503; - repeated int64 repeated_int64 = 504; - repeated sint64 repeated_sint64 = 505; - repeated uint64 repeated_uint64 = 506; - repeated fixed32 repeated_fixed32 = 507; - repeated sfixed32 repeated_sfixed32 = 508; - repeated float repeated_float = 509; - repeated fixed64 repeated_fixed64 = 510; - repeated sfixed64 repeated_sfixed64 = 511; - repeated double repeated_double = 512; - repeated string repeated_string = 513; - repeated bytes repeated_bytes = 514; + // Repeated fields. + repeated bool repeated_bool = 500; + repeated int32 repeated_int32 = 501; + repeated sint32 repeated_sint32 = 502; + repeated uint32 repeated_uint32 = 503; + repeated int64 repeated_int64 = 504; + repeated sint64 repeated_sint64 = 505; + repeated uint64 repeated_uint64 = 506; + repeated fixed32 repeated_fixed32 = 507; + repeated sfixed32 repeated_sfixed32 = 508; + repeated float repeated_float = 509; + repeated fixed64 repeated_fixed64 = 510; + repeated sfixed64 repeated_sfixed64 = 511; + repeated double repeated_double = 512; + repeated string repeated_string = 513; + repeated bytes repeated_bytes = 514; - repeated ChildEnum repeated_child_enum = 515; - repeated ChildMessage repeated_child_message = 516; - repeated NamedGroup repeated_named_group = 517; - repeated SiblingEnum repeated_sibling_enum = 518; - repeated SiblingMessage repeated_sibling_message = 519; - repeated group RepeatedGroup = 520 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + repeated ChildEnum repeated_child_enum = 515; + repeated ChildMessage repeated_child_message = 516; + repeated NamedGroup repeated_named_group = 517; + repeated SiblingEnum repeated_sibling_enum = 518; + repeated SiblingMessage repeated_sibling_message = 519; + repeated group RepeatedGroup = 520 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Map fields. - map<bool, bool> map_bool_bool = 600; - map<bool, int32> map_bool_int32 = 601; - map<bool, sint32> map_bool_sint32 = 602; - map<bool, uint32> map_bool_uint32 = 603; - map<bool, int64> map_bool_int64 = 604; - map<bool, sint64> map_bool_sint64 = 605; - map<bool, uint64> map_bool_uint64 = 606; - map<bool, fixed32> map_bool_fixed32 = 607; - map<bool, sfixed32> map_bool_sfixed32 = 608; - map<bool, float> map_bool_float = 609; - map<bool, fixed64> map_bool_fixed64 = 610; - map<bool, sfixed64> map_bool_sfixed64 = 611; - map<bool, double> map_bool_double = 612; - map<bool, string> map_bool_string = 613; - map<bool, bytes> map_bool_bytes = 614; + // Map fields. + map<bool, bool> map_bool_bool = 600; + map<bool, int32> map_bool_int32 = 601; + map<bool, sint32> map_bool_sint32 = 602; + map<bool, uint32> map_bool_uint32 = 603; + map<bool, int64> map_bool_int64 = 604; + map<bool, sint64> map_bool_sint64 = 605; + map<bool, uint64> map_bool_uint64 = 606; + map<bool, fixed32> map_bool_fixed32 = 607; + map<bool, sfixed32> map_bool_sfixed32 = 608; + map<bool, float> map_bool_float = 609; + map<bool, fixed64> map_bool_fixed64 = 610; + map<bool, sfixed64> map_bool_sfixed64 = 611; + map<bool, double> map_bool_double = 612; + map<bool, string> map_bool_string = 613; + map<bool, bytes> map_bool_bytes = 614; - map<bool, ChildEnum> map_bool_child_enum = 615; - map<bool, ChildMessage> map_bool_child_message = 616; - map<bool, NamedGroup> map_bool_named_group = 617; - map<bool, SiblingEnum> map_bool_sibling_enum = 618; - map<bool, SiblingMessage> map_bool_sibling_message = 619; + map<bool, ChildEnum> map_bool_child_enum = 615; + map<bool, ChildMessage> map_bool_child_message = 616; + map<bool, NamedGroup> map_bool_named_group = 617; + map<bool, SiblingEnum> map_bool_sibling_enum = 618; + map<bool, SiblingMessage> map_bool_sibling_message = 619; - map<int32, bool> map_int32_bool = 620; - map<sint32, bool> map_sint32_bool = 621; - map<uint32, bool> map_uint32_bool = 622; - map<int64, bool> map_int64_bool = 623; - map<sint64, bool> map_sint64_bool = 624; - map<uint64, bool> map_uint64_bool = 625; - map<fixed32, bool> map_fixed32_bool = 626; - map<string, bool> map_string_bool = 627; + map<int32, bool> map_int32_bool = 620; + map<sint32, bool> map_sint32_bool = 621; + map<uint32, bool> map_uint32_bool = 622; + map<int64, bool> map_int64_bool = 623; + map<sint64, bool> map_sint64_bool = 624; + map<uint64, bool> map_uint64_bool = 625; + map<fixed32, bool> map_fixed32_bool = 626; + map<string, bool> map_string_bool = 627; - // Oneof fields. - oneof oneof_union { - bool oneof_bool = 700; - int32 oneof_int32 = 701; - sint32 oneof_sint32 = 702; - uint32 oneof_uint32 = 703; - int64 oneof_int64 = 704; - sint64 oneof_sint64 = 705; - uint64 oneof_uint64 = 706; - fixed32 oneof_fixed32 = 707; - sfixed32 oneof_sfixed32 = 708; - float oneof_float = 709; - fixed64 oneof_fixed64 = 710; - sfixed64 oneof_sfixed64 = 711; - double oneof_double = 712; - string oneof_string = 713; - bytes oneof_bytes = 714; + // Oneof fields. + oneof oneof_union { + bool oneof_bool = 700; + int32 oneof_int32 = 701; + sint32 oneof_sint32 = 702; + uint32 oneof_uint32 = 703; + int64 oneof_int64 = 704; + sint64 oneof_sint64 = 705; + uint64 oneof_uint64 = 706; + fixed32 oneof_fixed32 = 707; + sfixed32 oneof_sfixed32 = 708; + float oneof_float = 709; + fixed64 oneof_fixed64 = 710; + sfixed64 oneof_sfixed64 = 711; + double oneof_double = 712; + string oneof_string = 713; + bytes oneof_bytes = 714; - ChildEnum oneof_child_enum = 715; - ChildMessage oneof_child_message = 716; - NamedGroup oneof_named_group = 717; - SiblingEnum oneof_sibling_enum = 718; - SiblingMessage oneof_sibling_message = 719; - group OneofGroup = 720 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + ChildEnum oneof_child_enum = 715; + ChildMessage oneof_child_message = 716; + NamedGroup oneof_named_group = 717; + SiblingEnum oneof_sibling_enum = 718; + SiblingMessage oneof_sibling_message = 719; + group OneofGroup = 720 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - string oneof_string1 = 721; - string oneof_string2 = 722; - string oneof_string3 = 723; - } + string oneof_string1 = 721; + string oneof_string2 = 722; + string oneof_string3 = 723; + } - // Oneof default fields. - oneof oneof_defaulted_union { - bool oneof_defaulted_bool = 800 [default = true]; - int32 oneof_defaulted_int32 = 801 [default = -12345]; - sint32 oneof_defaulted_sint32 = 802 [default = -3200]; - uint32 oneof_defaulted_uint32 = 803 [default = 3200]; - int64 oneof_defaulted_int64 = 804 [default = -123456789]; - sint64 oneof_defaulted_sint64 = 805 [default = -6400]; - uint64 oneof_defaulted_uint64 = 806 [default = 6400]; - fixed32 oneof_defaulted_fixed32 = 807 [default = 320000]; - sfixed32 oneof_defaulted_sfixed32 = 808 [default = -320000]; - float oneof_defaulted_float = 809 [default = 3.14159]; - fixed64 oneof_defaulted_fixed64 = 810 [default = 640000]; - sfixed64 oneof_defaulted_sfixed64 = 811 [default = -640000]; - double oneof_defaulted_double = 812 [default = 3.14159265359]; - string oneof_defaulted_string = 813 [default = "hello, \"world!\"\n"]; - bytes oneof_defaulted_bytes = 814 [default = "dead\xde\xad\xbe\xefbeef"]; + // Oneof default fields. + oneof oneof_defaulted_union { + bool oneof_defaulted_bool = 800 [default = true]; + int32 oneof_defaulted_int32 = 801 [default = -12345]; + sint32 oneof_defaulted_sint32 = 802 [default = -3200]; + uint32 oneof_defaulted_uint32 = 803 [default = 3200]; + int64 oneof_defaulted_int64 = 804 [default = -123456789]; + sint64 oneof_defaulted_sint64 = 805 [default = -6400]; + uint64 oneof_defaulted_uint64 = 806 [default = 6400]; + fixed32 oneof_defaulted_fixed32 = 807 [default = 320000]; + sfixed32 oneof_defaulted_sfixed32 = 808 [default = -320000]; + float oneof_defaulted_float = 809 [default = 3.14159]; + fixed64 oneof_defaulted_fixed64 = 810 [default = 640000]; + sfixed64 oneof_defaulted_sfixed64 = 811 [default = -640000]; + double oneof_defaulted_double = 812 [default = 3.14159265359]; + string oneof_defaulted_string = 813 [default = "hello, \"world!\"\n"]; + bytes oneof_defaulted_bytes = 814 [default = "dead\xde\xad\xbe\xefbeef"]; - ChildEnum oneof_defaulted_child_enum = 815 [default = ALPHA]; - SiblingEnum oneof_defaulted_sibling_enum = 816 [default = ALPHA]; - } + ChildEnum oneof_defaulted_child_enum = 815 [default = ALPHA]; + SiblingEnum oneof_defaulted_sibling_enum = 816 [default = ALPHA]; + } - // Extension fields. - extend Message { - // Optional fields. - optional bool extension_optional_bool = 10000; - optional int32 extension_optional_int32 = 10001; - optional sint32 extension_optional_sint32 = 10002; - optional uint32 extension_optional_uint32 = 10003; - optional int64 extension_optional_int64 = 10004; - optional sint64 extension_optional_sint64 = 10005; - optional uint64 extension_optional_uint64 = 10006; - optional fixed32 extension_optional_fixed32 = 10007; - optional sfixed32 extension_optional_sfixed32 = 10008; - optional float extension_optional_float = 10009; - optional fixed64 extension_optional_fixed64 = 10010; - optional sfixed64 extension_optional_sfixed64 = 10011; - optional double extension_optional_double = 10012; - optional string extension_optional_string = 10013; - optional bytes extension_optional_bytes = 10014; + // Extension fields. + extend Message { + // Optional fields. + optional bool extension_optional_bool = 10000; + optional int32 extension_optional_int32 = 10001; + optional sint32 extension_optional_sint32 = 10002; + optional uint32 extension_optional_uint32 = 10003; + optional int64 extension_optional_int64 = 10004; + optional sint64 extension_optional_sint64 = 10005; + optional uint64 extension_optional_uint64 = 10006; + optional fixed32 extension_optional_fixed32 = 10007; + optional sfixed32 extension_optional_sfixed32 = 10008; + optional float extension_optional_float = 10009; + optional fixed64 extension_optional_fixed64 = 10010; + optional sfixed64 extension_optional_sfixed64 = 10011; + optional double extension_optional_double = 10012; + optional string extension_optional_string = 10013; + optional bytes extension_optional_bytes = 10014; - optional ChildEnum extension_optional_child_enum = 10015; - optional ChildMessage extension_optional_child_message = 10016; - optional NamedGroup extension_optional_named_group = 10017; - optional SiblingEnum extension_optional_sibling_enum = 10018; - optional SiblingMessage extension_optional_sibling_message = 10019; - optional group ExtensionOptionalGroup = 10020 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + optional ChildEnum extension_optional_child_enum = 10015; + optional ChildMessage extension_optional_child_message = 10016; + optional NamedGroup extension_optional_named_group = 10017; + optional SiblingEnum extension_optional_sibling_enum = 10018; + optional SiblingMessage extension_optional_sibling_message = 10019; + optional group ExtensionOptionalGroup = 10020 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Optional default fields. - optional bool extension_defaulted_bool = 20000 [default = true]; - optional int32 extension_defaulted_int32 = 20001 [default = -12345]; - optional sint32 extension_defaulted_sint32 = 20002 [default = -3200]; - optional uint32 extension_defaulted_uint32 = 20003 [default = 3200]; - optional int64 extension_defaulted_int64 = 20004 [default = -123456789]; - optional sint64 extension_defaulted_sint64 = 20005 [default = -6400]; - optional uint64 extension_defaulted_uint64 = 20006 [default = 6400]; - optional fixed32 extension_defaulted_fixed32 = 20007 [default = 320000]; - optional sfixed32 extension_defaulted_sfixed32 = 20008 [default = -320000]; - optional float extension_defaulted_float = 20009 [default = 3.14159]; - optional fixed64 extension_defaulted_fixed64 = 20010 [default = 640000]; - optional sfixed64 extension_defaulted_sfixed64 = 20011 [default = -640000]; - optional double extension_defaulted_double = 20012 [default = 3.14159265359]; - optional string extension_defaulted_string = 20013 [default = "hello, \"world!\"\n"]; - optional bytes extension_defaulted_bytes = 20014 [default = "dead\xde\xad\xbe\xefbeef"]; + // Optional default fields. + optional bool extension_defaulted_bool = 20000 [default = true]; + optional int32 extension_defaulted_int32 = 20001 [default = -12345]; + optional sint32 extension_defaulted_sint32 = 20002 [default = -3200]; + optional uint32 extension_defaulted_uint32 = 20003 [default = 3200]; + optional int64 extension_defaulted_int64 = 20004 [default = -123456789]; + optional sint64 extension_defaulted_sint64 = 20005 [default = -6400]; + optional uint64 extension_defaulted_uint64 = 20006 [default = 6400]; + optional fixed32 extension_defaulted_fixed32 = 20007 [default = 320000]; + optional sfixed32 extension_defaulted_sfixed32 = 20008 [default = -320000]; + optional float extension_defaulted_float = 20009 [default = 3.14159]; + optional fixed64 extension_defaulted_fixed64 = 20010 [default = 640000]; + optional sfixed64 extension_defaulted_sfixed64 = 20011 [default = -640000]; + optional double extension_defaulted_double = 20012 + [default = 3.14159265359]; + optional string extension_defaulted_string = 20013 + [default = "hello, \"world!\"\n"]; + optional bytes extension_defaulted_bytes = 20014 + [default = "dead\xde\xad\xbe\xefbeef"]; - optional ChildEnum extension_defaulted_child_enum = 20015 [default = ALPHA]; - optional SiblingEnum extension_defaulted_sibling_enum = 20016 [default = ALPHA]; + optional ChildEnum extension_defaulted_child_enum = 20015 [default = ALPHA]; + optional SiblingEnum extension_defaulted_sibling_enum = 20016 + [default = ALPHA]; - // Repeated fields. - repeated bool extension_repeated_bool = 30000; - repeated int32 extension_repeated_int32 = 30001; - repeated sint32 extension_repeated_sint32 = 30002; - repeated uint32 extension_repeated_uint32 = 30003; - repeated int64 extension_repeated_int64 = 30004; - repeated sint64 extension_repeated_sint64 = 30005; - repeated uint64 extension_repeated_uint64 = 30006; - repeated fixed32 extension_repeated_fixed32 = 30007; - repeated sfixed32 extension_repeated_sfixed32 = 30008; - repeated float extension_repeated_float = 30009; - repeated fixed64 extension_repeated_fixed64 = 30010; - repeated sfixed64 extension_repeated_sfixed64 = 30011; - repeated double extension_repeated_double = 30012; - repeated string extension_repeated_string = 30013; - repeated bytes extension_repeated_bytes = 30014; + // Repeated fields. + repeated bool extension_repeated_bool = 30000; + repeated int32 extension_repeated_int32 = 30001; + repeated sint32 extension_repeated_sint32 = 30002; + repeated uint32 extension_repeated_uint32 = 30003; + repeated int64 extension_repeated_int64 = 30004; + repeated sint64 extension_repeated_sint64 = 30005; + repeated uint64 extension_repeated_uint64 = 30006; + repeated fixed32 extension_repeated_fixed32 = 30007; + repeated sfixed32 extension_repeated_sfixed32 = 30008; + repeated float extension_repeated_float = 30009; + repeated fixed64 extension_repeated_fixed64 = 30010; + repeated sfixed64 extension_repeated_sfixed64 = 30011; + repeated double extension_repeated_double = 30012; + repeated string extension_repeated_string = 30013; + repeated bytes extension_repeated_bytes = 30014; - repeated ChildEnum extension_repeated_child_enum = 30015; - repeated ChildMessage extension_repeated_child_message = 30016; - repeated NamedGroup extension_repeated_named_group = 30017; - repeated SiblingEnum extension_repeated_sibling_enum = 30018; - repeated SiblingMessage extension_repeated_sibling_message = 30019; - repeated group ExtensionRepeatedGroup = 30020 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } - } + repeated ChildEnum extension_repeated_child_enum = 30015; + repeated ChildMessage extension_repeated_child_message = 30016; + repeated NamedGroup extension_repeated_named_group = 30017; + repeated SiblingEnum extension_repeated_sibling_enum = 30018; + repeated SiblingMessage extension_repeated_sibling_message = 30019; + repeated group ExtensionRepeatedGroup = 30020 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } + } - extensions 10000 to max; + extensions 10000 to max; } diff --git a/internal/testprotos/legacy/proto2_20180125_92554152/test.proto b/internal/testprotos/legacy/proto2_20180125_92554152/test.proto index a714d830..2e39eea7 100644 --- a/internal/testprotos/legacy/proto2_20180125_92554152/test.proto +++ b/internal/testprotos/legacy/proto2_20180125_92554152/test.proto @@ -5,329 +5,336 @@ syntax = "proto2"; package google.golang.org.proto2_20180125; + option go_package = "google.golang.org/protobuf/internal/testprotos/legacy/proto2_20180125_92554152"; enum SiblingEnum { - ALPHA = 0; - BRAVO = 10; - CHARLIE = 200; + ALPHA = 0; + BRAVO = 10; + CHARLIE = 200; } message SiblingMessage { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; } message Message { - enum ChildEnum { - ALPHA = 0; - BRAVO = 1; - CHARLIE = 2; - } - message ChildMessage { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; - } - optional group NamedGroup = 1 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; - } + enum ChildEnum { + ALPHA = 0; + BRAVO = 1; + CHARLIE = 2; + } + message ChildMessage { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; + } + optional group NamedGroup = 1 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; + } - // Optional fields. - optional bool optional_bool = 100; - optional int32 optional_int32 = 101; - optional sint32 optional_sint32 = 102; - optional uint32 optional_uint32 = 103; - optional int64 optional_int64 = 104; - optional sint64 optional_sint64 = 105; - optional uint64 optional_uint64 = 106; - optional fixed32 optional_fixed32 = 107; - optional sfixed32 optional_sfixed32 = 108; - optional float optional_float = 109; - optional fixed64 optional_fixed64 = 110; - optional sfixed64 optional_sfixed64 = 111; - optional double optional_double = 112; - optional string optional_string = 113; - optional bytes optional_bytes = 114; + // Optional fields. + optional bool optional_bool = 100; + optional int32 optional_int32 = 101; + optional sint32 optional_sint32 = 102; + optional uint32 optional_uint32 = 103; + optional int64 optional_int64 = 104; + optional sint64 optional_sint64 = 105; + optional uint64 optional_uint64 = 106; + optional fixed32 optional_fixed32 = 107; + optional sfixed32 optional_sfixed32 = 108; + optional float optional_float = 109; + optional fixed64 optional_fixed64 = 110; + optional sfixed64 optional_sfixed64 = 111; + optional double optional_double = 112; + optional string optional_string = 113; + optional bytes optional_bytes = 114; - optional ChildEnum optional_child_enum = 115; - optional ChildMessage optional_child_message = 116; - optional NamedGroup optional_named_group = 117; - optional SiblingEnum optional_sibling_enum = 118; - optional SiblingMessage optional_sibling_message = 119; - optional group OptionalGroup = 120 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + optional ChildEnum optional_child_enum = 115; + optional ChildMessage optional_child_message = 116; + optional NamedGroup optional_named_group = 117; + optional SiblingEnum optional_sibling_enum = 118; + optional SiblingMessage optional_sibling_message = 119; + optional group OptionalGroup = 120 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Optional default fields. - optional bool defaulted_bool = 200 [default = true]; - optional int32 defaulted_int32 = 201 [default = -12345]; - optional sint32 defaulted_sint32 = 202 [default = -3200]; - optional uint32 defaulted_uint32 = 203 [default = 3200]; - optional int64 defaulted_int64 = 204 [default = -123456789]; - optional sint64 defaulted_sint64 = 205 [default = -6400]; - optional uint64 defaulted_uint64 = 206 [default = 6400]; - optional fixed32 defaulted_fixed32 = 207 [default = 320000]; - optional sfixed32 defaulted_sfixed32 = 208 [default = -320000]; - optional float defaulted_float = 209 [default = 3.14159]; - optional fixed64 defaulted_fixed64 = 210 [default = 640000]; - optional sfixed64 defaulted_sfixed64 = 211 [default = -640000]; - optional double defaulted_double = 212 [default = 3.14159265359]; - optional string defaulted_string = 213 [default = "hello, \"world!\"\n"]; - optional bytes defaulted_bytes = 214 [default = "dead\xde\xad\xbe\xefbeef"]; + // Optional default fields. + optional bool defaulted_bool = 200 [default = true]; + optional int32 defaulted_int32 = 201 [default = -12345]; + optional sint32 defaulted_sint32 = 202 [default = -3200]; + optional uint32 defaulted_uint32 = 203 [default = 3200]; + optional int64 defaulted_int64 = 204 [default = -123456789]; + optional sint64 defaulted_sint64 = 205 [default = -6400]; + optional uint64 defaulted_uint64 = 206 [default = 6400]; + optional fixed32 defaulted_fixed32 = 207 [default = 320000]; + optional sfixed32 defaulted_sfixed32 = 208 [default = -320000]; + optional float defaulted_float = 209 [default = 3.14159]; + optional fixed64 defaulted_fixed64 = 210 [default = 640000]; + optional sfixed64 defaulted_sfixed64 = 211 [default = -640000]; + optional double defaulted_double = 212 [default = 3.14159265359]; + optional string defaulted_string = 213 [default = "hello, \"world!\"\n"]; + optional bytes defaulted_bytes = 214 [default = "dead\xde\xad\xbe\xefbeef"]; - optional ChildEnum defaulted_child_enum = 215 [default = ALPHA]; - optional SiblingEnum defaulted_sibling_enum = 216 [default = ALPHA]; + optional ChildEnum defaulted_child_enum = 215 [default = ALPHA]; + optional SiblingEnum defaulted_sibling_enum = 216 [default = ALPHA]; - // Required fields. - required bool required_bool = 300; - required int32 required_int32 = 301; - required sint32 required_sint32 = 302; - required uint32 required_uint32 = 303; - required int64 required_int64 = 304; - required sint64 required_sint64 = 305; - required uint64 required_uint64 = 306; - required fixed32 required_fixed32 = 307; - required sfixed32 required_sfixed32 = 308; - required float required_float = 309; - required fixed64 required_fixed64 = 310; - required sfixed64 required_sfixed64 = 311; - required double required_double = 312; - required string required_string = 313; - required bytes required_bytes = 314; + // Required fields. + required bool required_bool = 300; + required int32 required_int32 = 301; + required sint32 required_sint32 = 302; + required uint32 required_uint32 = 303; + required int64 required_int64 = 304; + required sint64 required_sint64 = 305; + required uint64 required_uint64 = 306; + required fixed32 required_fixed32 = 307; + required sfixed32 required_sfixed32 = 308; + required float required_float = 309; + required fixed64 required_fixed64 = 310; + required sfixed64 required_sfixed64 = 311; + required double required_double = 312; + required string required_string = 313; + required bytes required_bytes = 314; - required ChildEnum required_child_enum = 315; - required ChildMessage required_child_message = 316; - required NamedGroup required_named_group = 317; - required SiblingEnum required_sibling_enum = 318; - required SiblingMessage required_sibling_message = 319; - required group RequiredGroup = 320 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } - // Required default fields. - required bool required_defaulted_bool = 400 [default = true]; - required int32 required_defaulted_int32 = 401 [default = -12345]; - required sint32 required_defaulted_sint32 = 402 [default = -3200]; - required uint32 required_defaulted_uint32 = 403 [default = 3200]; - required int64 required_defaulted_int64 = 404 [default = -123456789]; - required sint64 required_defaulted_sint64 = 405 [default = -6400]; - required uint64 required_defaulted_uint64 = 406 [default = 6400]; - required fixed32 required_defaulted_fixed32 = 407 [default = 320000]; - required sfixed32 required_defaulted_sfixed32 = 408 [default = -320000]; - required float required_defaulted_float = 409 [default = 3.14159]; - required fixed64 required_defaulted_fixed64 = 410 [default = 640000]; - required sfixed64 required_defaulted_sfixed64 = 411 [default = -640000]; - required double required_defaulted_double = 412 [default = 3.14159265359]; - required string required_defaulted_string = 413 [default = "hello, \"world!\"\n"]; - required bytes required_defaulted_bytes = 414 [default = "dead\xde\xad\xbe\xefbeef"]; + required ChildEnum required_child_enum = 315; + required ChildMessage required_child_message = 316; + required NamedGroup required_named_group = 317; + required SiblingEnum required_sibling_enum = 318; + required SiblingMessage required_sibling_message = 319; + required group RequiredGroup = 320 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } + // Required default fields. + required bool required_defaulted_bool = 400 [default = true]; + required int32 required_defaulted_int32 = 401 [default = -12345]; + required sint32 required_defaulted_sint32 = 402 [default = -3200]; + required uint32 required_defaulted_uint32 = 403 [default = 3200]; + required int64 required_defaulted_int64 = 404 [default = -123456789]; + required sint64 required_defaulted_sint64 = 405 [default = -6400]; + required uint64 required_defaulted_uint64 = 406 [default = 6400]; + required fixed32 required_defaulted_fixed32 = 407 [default = 320000]; + required sfixed32 required_defaulted_sfixed32 = 408 [default = -320000]; + required float required_defaulted_float = 409 [default = 3.14159]; + required fixed64 required_defaulted_fixed64 = 410 [default = 640000]; + required sfixed64 required_defaulted_sfixed64 = 411 [default = -640000]; + required double required_defaulted_double = 412 [default = 3.14159265359]; + required string required_defaulted_string = 413 + [default = "hello, \"world!\"\n"]; + required bytes required_defaulted_bytes = 414 + [default = "dead\xde\xad\xbe\xefbeef"]; - required ChildEnum required_defaulted_child_enum = 415 [default = ALPHA]; - required SiblingEnum required_defaulted_sibling_enum = 416 [default = ALPHA]; + required ChildEnum required_defaulted_child_enum = 415 [default = ALPHA]; + required SiblingEnum required_defaulted_sibling_enum = 416 [default = ALPHA]; - // Repeated fields. - repeated bool repeated_bool = 500; - repeated int32 repeated_int32 = 501; - repeated sint32 repeated_sint32 = 502; - repeated uint32 repeated_uint32 = 503; - repeated int64 repeated_int64 = 504; - repeated sint64 repeated_sint64 = 505; - repeated uint64 repeated_uint64 = 506; - repeated fixed32 repeated_fixed32 = 507; - repeated sfixed32 repeated_sfixed32 = 508; - repeated float repeated_float = 509; - repeated fixed64 repeated_fixed64 = 510; - repeated sfixed64 repeated_sfixed64 = 511; - repeated double repeated_double = 512; - repeated string repeated_string = 513; - repeated bytes repeated_bytes = 514; + // Repeated fields. + repeated bool repeated_bool = 500; + repeated int32 repeated_int32 = 501; + repeated sint32 repeated_sint32 = 502; + repeated uint32 repeated_uint32 = 503; + repeated int64 repeated_int64 = 504; + repeated sint64 repeated_sint64 = 505; + repeated uint64 repeated_uint64 = 506; + repeated fixed32 repeated_fixed32 = 507; + repeated sfixed32 repeated_sfixed32 = 508; + repeated float repeated_float = 509; + repeated fixed64 repeated_fixed64 = 510; + repeated sfixed64 repeated_sfixed64 = 511; + repeated double repeated_double = 512; + repeated string repeated_string = 513; + repeated bytes repeated_bytes = 514; - repeated ChildEnum repeated_child_enum = 515; - repeated ChildMessage repeated_child_message = 516; - repeated NamedGroup repeated_named_group = 517; - repeated SiblingEnum repeated_sibling_enum = 518; - repeated SiblingMessage repeated_sibling_message = 519; - repeated group RepeatedGroup = 520 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + repeated ChildEnum repeated_child_enum = 515; + repeated ChildMessage repeated_child_message = 516; + repeated NamedGroup repeated_named_group = 517; + repeated SiblingEnum repeated_sibling_enum = 518; + repeated SiblingMessage repeated_sibling_message = 519; + repeated group RepeatedGroup = 520 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Map fields. - map<bool, bool> map_bool_bool = 600; - map<bool, int32> map_bool_int32 = 601; - map<bool, sint32> map_bool_sint32 = 602; - map<bool, uint32> map_bool_uint32 = 603; - map<bool, int64> map_bool_int64 = 604; - map<bool, sint64> map_bool_sint64 = 605; - map<bool, uint64> map_bool_uint64 = 606; - map<bool, fixed32> map_bool_fixed32 = 607; - map<bool, sfixed32> map_bool_sfixed32 = 608; - map<bool, float> map_bool_float = 609; - map<bool, fixed64> map_bool_fixed64 = 610; - map<bool, sfixed64> map_bool_sfixed64 = 611; - map<bool, double> map_bool_double = 612; - map<bool, string> map_bool_string = 613; - map<bool, bytes> map_bool_bytes = 614; + // Map fields. + map<bool, bool> map_bool_bool = 600; + map<bool, int32> map_bool_int32 = 601; + map<bool, sint32> map_bool_sint32 = 602; + map<bool, uint32> map_bool_uint32 = 603; + map<bool, int64> map_bool_int64 = 604; + map<bool, sint64> map_bool_sint64 = 605; + map<bool, uint64> map_bool_uint64 = 606; + map<bool, fixed32> map_bool_fixed32 = 607; + map<bool, sfixed32> map_bool_sfixed32 = 608; + map<bool, float> map_bool_float = 609; + map<bool, fixed64> map_bool_fixed64 = 610; + map<bool, sfixed64> map_bool_sfixed64 = 611; + map<bool, double> map_bool_double = 612; + map<bool, string> map_bool_string = 613; + map<bool, bytes> map_bool_bytes = 614; - map<bool, ChildEnum> map_bool_child_enum = 615; - map<bool, ChildMessage> map_bool_child_message = 616; - map<bool, NamedGroup> map_bool_named_group = 617; - map<bool, SiblingEnum> map_bool_sibling_enum = 618; - map<bool, SiblingMessage> map_bool_sibling_message = 619; + map<bool, ChildEnum> map_bool_child_enum = 615; + map<bool, ChildMessage> map_bool_child_message = 616; + map<bool, NamedGroup> map_bool_named_group = 617; + map<bool, SiblingEnum> map_bool_sibling_enum = 618; + map<bool, SiblingMessage> map_bool_sibling_message = 619; - map<int32, bool> map_int32_bool = 620; - map<sint32, bool> map_sint32_bool = 621; - map<uint32, bool> map_uint32_bool = 622; - map<int64, bool> map_int64_bool = 623; - map<sint64, bool> map_sint64_bool = 624; - map<uint64, bool> map_uint64_bool = 625; - map<fixed32, bool> map_fixed32_bool = 626; - map<string, bool> map_string_bool = 627; + map<int32, bool> map_int32_bool = 620; + map<sint32, bool> map_sint32_bool = 621; + map<uint32, bool> map_uint32_bool = 622; + map<int64, bool> map_int64_bool = 623; + map<sint64, bool> map_sint64_bool = 624; + map<uint64, bool> map_uint64_bool = 625; + map<fixed32, bool> map_fixed32_bool = 626; + map<string, bool> map_string_bool = 627; - // Oneof fields. - oneof oneof_union { - bool oneof_bool = 700; - int32 oneof_int32 = 701; - sint32 oneof_sint32 = 702; - uint32 oneof_uint32 = 703; - int64 oneof_int64 = 704; - sint64 oneof_sint64 = 705; - uint64 oneof_uint64 = 706; - fixed32 oneof_fixed32 = 707; - sfixed32 oneof_sfixed32 = 708; - float oneof_float = 709; - fixed64 oneof_fixed64 = 710; - sfixed64 oneof_sfixed64 = 711; - double oneof_double = 712; - string oneof_string = 713; - bytes oneof_bytes = 714; + // Oneof fields. + oneof oneof_union { + bool oneof_bool = 700; + int32 oneof_int32 = 701; + sint32 oneof_sint32 = 702; + uint32 oneof_uint32 = 703; + int64 oneof_int64 = 704; + sint64 oneof_sint64 = 705; + uint64 oneof_uint64 = 706; + fixed32 oneof_fixed32 = 707; + sfixed32 oneof_sfixed32 = 708; + float oneof_float = 709; + fixed64 oneof_fixed64 = 710; + sfixed64 oneof_sfixed64 = 711; + double oneof_double = 712; + string oneof_string = 713; + bytes oneof_bytes = 714; - ChildEnum oneof_child_enum = 715; - ChildMessage oneof_child_message = 716; - NamedGroup oneof_named_group = 717; - SiblingEnum oneof_sibling_enum = 718; - SiblingMessage oneof_sibling_message = 719; - group OneofGroup = 720 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + ChildEnum oneof_child_enum = 715; + ChildMessage oneof_child_message = 716; + NamedGroup oneof_named_group = 717; + SiblingEnum oneof_sibling_enum = 718; + SiblingMessage oneof_sibling_message = 719; + group OneofGroup = 720 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - string oneof_string1 = 721; - string oneof_string2 = 722; - string oneof_string3 = 723; - } + string oneof_string1 = 721; + string oneof_string2 = 722; + string oneof_string3 = 723; + } - // Oneof default fields. - oneof oneof_defaulted_union { - bool oneof_defaulted_bool = 800 [default = true]; - int32 oneof_defaulted_int32 = 801 [default = -12345]; - sint32 oneof_defaulted_sint32 = 802 [default = -3200]; - uint32 oneof_defaulted_uint32 = 803 [default = 3200]; - int64 oneof_defaulted_int64 = 804 [default = -123456789]; - sint64 oneof_defaulted_sint64 = 805 [default = -6400]; - uint64 oneof_defaulted_uint64 = 806 [default = 6400]; - fixed32 oneof_defaulted_fixed32 = 807 [default = 320000]; - sfixed32 oneof_defaulted_sfixed32 = 808 [default = -320000]; - float oneof_defaulted_float = 809 [default = 3.14159]; - fixed64 oneof_defaulted_fixed64 = 810 [default = 640000]; - sfixed64 oneof_defaulted_sfixed64 = 811 [default = -640000]; - double oneof_defaulted_double = 812 [default = 3.14159265359]; - string oneof_defaulted_string = 813 [default = "hello, \"world!\"\n"]; - bytes oneof_defaulted_bytes = 814 [default = "dead\xde\xad\xbe\xefbeef"]; + // Oneof default fields. + oneof oneof_defaulted_union { + bool oneof_defaulted_bool = 800 [default = true]; + int32 oneof_defaulted_int32 = 801 [default = -12345]; + sint32 oneof_defaulted_sint32 = 802 [default = -3200]; + uint32 oneof_defaulted_uint32 = 803 [default = 3200]; + int64 oneof_defaulted_int64 = 804 [default = -123456789]; + sint64 oneof_defaulted_sint64 = 805 [default = -6400]; + uint64 oneof_defaulted_uint64 = 806 [default = 6400]; + fixed32 oneof_defaulted_fixed32 = 807 [default = 320000]; + sfixed32 oneof_defaulted_sfixed32 = 808 [default = -320000]; + float oneof_defaulted_float = 809 [default = 3.14159]; + fixed64 oneof_defaulted_fixed64 = 810 [default = 640000]; + sfixed64 oneof_defaulted_sfixed64 = 811 [default = -640000]; + double oneof_defaulted_double = 812 [default = 3.14159265359]; + string oneof_defaulted_string = 813 [default = "hello, \"world!\"\n"]; + bytes oneof_defaulted_bytes = 814 [default = "dead\xde\xad\xbe\xefbeef"]; - ChildEnum oneof_defaulted_child_enum = 815 [default = ALPHA]; - SiblingEnum oneof_defaulted_sibling_enum = 816 [default = ALPHA]; - } + ChildEnum oneof_defaulted_child_enum = 815 [default = ALPHA]; + SiblingEnum oneof_defaulted_sibling_enum = 816 [default = ALPHA]; + } - // Extension fields. - extend Message { - // Optional fields. - optional bool extension_optional_bool = 10000; - optional int32 extension_optional_int32 = 10001; - optional sint32 extension_optional_sint32 = 10002; - optional uint32 extension_optional_uint32 = 10003; - optional int64 extension_optional_int64 = 10004; - optional sint64 extension_optional_sint64 = 10005; - optional uint64 extension_optional_uint64 = 10006; - optional fixed32 extension_optional_fixed32 = 10007; - optional sfixed32 extension_optional_sfixed32 = 10008; - optional float extension_optional_float = 10009; - optional fixed64 extension_optional_fixed64 = 10010; - optional sfixed64 extension_optional_sfixed64 = 10011; - optional double extension_optional_double = 10012; - optional string extension_optional_string = 10013; - optional bytes extension_optional_bytes = 10014; + // Extension fields. + extend Message { + // Optional fields. + optional bool extension_optional_bool = 10000; + optional int32 extension_optional_int32 = 10001; + optional sint32 extension_optional_sint32 = 10002; + optional uint32 extension_optional_uint32 = 10003; + optional int64 extension_optional_int64 = 10004; + optional sint64 extension_optional_sint64 = 10005; + optional uint64 extension_optional_uint64 = 10006; + optional fixed32 extension_optional_fixed32 = 10007; + optional sfixed32 extension_optional_sfixed32 = 10008; + optional float extension_optional_float = 10009; + optional fixed64 extension_optional_fixed64 = 10010; + optional sfixed64 extension_optional_sfixed64 = 10011; + optional double extension_optional_double = 10012; + optional string extension_optional_string = 10013; + optional bytes extension_optional_bytes = 10014; - optional ChildEnum extension_optional_child_enum = 10015; - optional ChildMessage extension_optional_child_message = 10016; - optional NamedGroup extension_optional_named_group = 10017; - optional SiblingEnum extension_optional_sibling_enum = 10018; - optional SiblingMessage extension_optional_sibling_message = 10019; - optional group ExtensionOptionalGroup = 10020 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + optional ChildEnum extension_optional_child_enum = 10015; + optional ChildMessage extension_optional_child_message = 10016; + optional NamedGroup extension_optional_named_group = 10017; + optional SiblingEnum extension_optional_sibling_enum = 10018; + optional SiblingMessage extension_optional_sibling_message = 10019; + optional group ExtensionOptionalGroup = 10020 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Optional default fields. - optional bool extension_defaulted_bool = 20000 [default = true]; - optional int32 extension_defaulted_int32 = 20001 [default = -12345]; - optional sint32 extension_defaulted_sint32 = 20002 [default = -3200]; - optional uint32 extension_defaulted_uint32 = 20003 [default = 3200]; - optional int64 extension_defaulted_int64 = 20004 [default = -123456789]; - optional sint64 extension_defaulted_sint64 = 20005 [default = -6400]; - optional uint64 extension_defaulted_uint64 = 20006 [default = 6400]; - optional fixed32 extension_defaulted_fixed32 = 20007 [default = 320000]; - optional sfixed32 extension_defaulted_sfixed32 = 20008 [default = -320000]; - optional float extension_defaulted_float = 20009 [default = 3.14159]; - optional fixed64 extension_defaulted_fixed64 = 20010 [default = 640000]; - optional sfixed64 extension_defaulted_sfixed64 = 20011 [default = -640000]; - optional double extension_defaulted_double = 20012 [default = 3.14159265359]; - optional string extension_defaulted_string = 20013 [default = "hello, \"world!\"\n"]; - optional bytes extension_defaulted_bytes = 20014 [default = "dead\xde\xad\xbe\xefbeef"]; + // Optional default fields. + optional bool extension_defaulted_bool = 20000 [default = true]; + optional int32 extension_defaulted_int32 = 20001 [default = -12345]; + optional sint32 extension_defaulted_sint32 = 20002 [default = -3200]; + optional uint32 extension_defaulted_uint32 = 20003 [default = 3200]; + optional int64 extension_defaulted_int64 = 20004 [default = -123456789]; + optional sint64 extension_defaulted_sint64 = 20005 [default = -6400]; + optional uint64 extension_defaulted_uint64 = 20006 [default = 6400]; + optional fixed32 extension_defaulted_fixed32 = 20007 [default = 320000]; + optional sfixed32 extension_defaulted_sfixed32 = 20008 [default = -320000]; + optional float extension_defaulted_float = 20009 [default = 3.14159]; + optional fixed64 extension_defaulted_fixed64 = 20010 [default = 640000]; + optional sfixed64 extension_defaulted_sfixed64 = 20011 [default = -640000]; + optional double extension_defaulted_double = 20012 + [default = 3.14159265359]; + optional string extension_defaulted_string = 20013 + [default = "hello, \"world!\"\n"]; + optional bytes extension_defaulted_bytes = 20014 + [default = "dead\xde\xad\xbe\xefbeef"]; - optional ChildEnum extension_defaulted_child_enum = 20015 [default = ALPHA]; - optional SiblingEnum extension_defaulted_sibling_enum = 20016 [default = ALPHA]; + optional ChildEnum extension_defaulted_child_enum = 20015 [default = ALPHA]; + optional SiblingEnum extension_defaulted_sibling_enum = 20016 + [default = ALPHA]; - // Repeated fields. - repeated bool extension_repeated_bool = 30000; - repeated int32 extension_repeated_int32 = 30001; - repeated sint32 extension_repeated_sint32 = 30002; - repeated uint32 extension_repeated_uint32 = 30003; - repeated int64 extension_repeated_int64 = 30004; - repeated sint64 extension_repeated_sint64 = 30005; - repeated uint64 extension_repeated_uint64 = 30006; - repeated fixed32 extension_repeated_fixed32 = 30007; - repeated sfixed32 extension_repeated_sfixed32 = 30008; - repeated float extension_repeated_float = 30009; - repeated fixed64 extension_repeated_fixed64 = 30010; - repeated sfixed64 extension_repeated_sfixed64 = 30011; - repeated double extension_repeated_double = 30012; - repeated string extension_repeated_string = 30013; - repeated bytes extension_repeated_bytes = 30014; + // Repeated fields. + repeated bool extension_repeated_bool = 30000; + repeated int32 extension_repeated_int32 = 30001; + repeated sint32 extension_repeated_sint32 = 30002; + repeated uint32 extension_repeated_uint32 = 30003; + repeated int64 extension_repeated_int64 = 30004; + repeated sint64 extension_repeated_sint64 = 30005; + repeated uint64 extension_repeated_uint64 = 30006; + repeated fixed32 extension_repeated_fixed32 = 30007; + repeated sfixed32 extension_repeated_sfixed32 = 30008; + repeated float extension_repeated_float = 30009; + repeated fixed64 extension_repeated_fixed64 = 30010; + repeated sfixed64 extension_repeated_sfixed64 = 30011; + repeated double extension_repeated_double = 30012; + repeated string extension_repeated_string = 30013; + repeated bytes extension_repeated_bytes = 30014; - repeated ChildEnum extension_repeated_child_enum = 30015; - repeated ChildMessage extension_repeated_child_message = 30016; - repeated NamedGroup extension_repeated_named_group = 30017; - repeated SiblingEnum extension_repeated_sibling_enum = 30018; - repeated SiblingMessage extension_repeated_sibling_message = 30019; - repeated group ExtensionRepeatedGroup = 30020 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } - } + repeated ChildEnum extension_repeated_child_enum = 30015; + repeated ChildMessage extension_repeated_child_message = 30016; + repeated NamedGroup extension_repeated_named_group = 30017; + repeated SiblingEnum extension_repeated_sibling_enum = 30018; + repeated SiblingMessage extension_repeated_sibling_message = 30019; + repeated group ExtensionRepeatedGroup = 30020 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } + } - extensions 10000 to max; + extensions 10000 to max; } diff --git a/internal/testprotos/legacy/proto2_20180430_b4deda09/test.proto b/internal/testprotos/legacy/proto2_20180430_b4deda09/test.proto index d3850eb4..fea59a15 100644 --- a/internal/testprotos/legacy/proto2_20180430_b4deda09/test.proto +++ b/internal/testprotos/legacy/proto2_20180430_b4deda09/test.proto @@ -5,329 +5,336 @@ syntax = "proto2"; package google.golang.org.proto2_20180430; + option go_package = "google.golang.org/protobuf/internal/testprotos/legacy/proto2_20180430_b4deda09"; enum SiblingEnum { - ALPHA = 0; - BRAVO = 10; - CHARLIE = 200; + ALPHA = 0; + BRAVO = 10; + CHARLIE = 200; } message SiblingMessage { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; } message Message { - enum ChildEnum { - ALPHA = 0; - BRAVO = 1; - CHARLIE = 2; - } - message ChildMessage { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; - } - optional group NamedGroup = 1 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; - } + enum ChildEnum { + ALPHA = 0; + BRAVO = 1; + CHARLIE = 2; + } + message ChildMessage { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; + } + optional group NamedGroup = 1 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; + } - // Optional fields. - optional bool optional_bool = 100; - optional int32 optional_int32 = 101; - optional sint32 optional_sint32 = 102; - optional uint32 optional_uint32 = 103; - optional int64 optional_int64 = 104; - optional sint64 optional_sint64 = 105; - optional uint64 optional_uint64 = 106; - optional fixed32 optional_fixed32 = 107; - optional sfixed32 optional_sfixed32 = 108; - optional float optional_float = 109; - optional fixed64 optional_fixed64 = 110; - optional sfixed64 optional_sfixed64 = 111; - optional double optional_double = 112; - optional string optional_string = 113; - optional bytes optional_bytes = 114; + // Optional fields. + optional bool optional_bool = 100; + optional int32 optional_int32 = 101; + optional sint32 optional_sint32 = 102; + optional uint32 optional_uint32 = 103; + optional int64 optional_int64 = 104; + optional sint64 optional_sint64 = 105; + optional uint64 optional_uint64 = 106; + optional fixed32 optional_fixed32 = 107; + optional sfixed32 optional_sfixed32 = 108; + optional float optional_float = 109; + optional fixed64 optional_fixed64 = 110; + optional sfixed64 optional_sfixed64 = 111; + optional double optional_double = 112; + optional string optional_string = 113; + optional bytes optional_bytes = 114; - optional ChildEnum optional_child_enum = 115; - optional ChildMessage optional_child_message = 116; - optional NamedGroup optional_named_group = 117; - optional SiblingEnum optional_sibling_enum = 118; - optional SiblingMessage optional_sibling_message = 119; - optional group OptionalGroup = 120 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + optional ChildEnum optional_child_enum = 115; + optional ChildMessage optional_child_message = 116; + optional NamedGroup optional_named_group = 117; + optional SiblingEnum optional_sibling_enum = 118; + optional SiblingMessage optional_sibling_message = 119; + optional group OptionalGroup = 120 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Optional default fields. - optional bool defaulted_bool = 200 [default = true]; - optional int32 defaulted_int32 = 201 [default = -12345]; - optional sint32 defaulted_sint32 = 202 [default = -3200]; - optional uint32 defaulted_uint32 = 203 [default = 3200]; - optional int64 defaulted_int64 = 204 [default = -123456789]; - optional sint64 defaulted_sint64 = 205 [default = -6400]; - optional uint64 defaulted_uint64 = 206 [default = 6400]; - optional fixed32 defaulted_fixed32 = 207 [default = 320000]; - optional sfixed32 defaulted_sfixed32 = 208 [default = -320000]; - optional float defaulted_float = 209 [default = 3.14159]; - optional fixed64 defaulted_fixed64 = 210 [default = 640000]; - optional sfixed64 defaulted_sfixed64 = 211 [default = -640000]; - optional double defaulted_double = 212 [default = 3.14159265359]; - optional string defaulted_string = 213 [default = "hello, \"world!\"\n"]; - optional bytes defaulted_bytes = 214 [default = "dead\xde\xad\xbe\xefbeef"]; + // Optional default fields. + optional bool defaulted_bool = 200 [default = true]; + optional int32 defaulted_int32 = 201 [default = -12345]; + optional sint32 defaulted_sint32 = 202 [default = -3200]; + optional uint32 defaulted_uint32 = 203 [default = 3200]; + optional int64 defaulted_int64 = 204 [default = -123456789]; + optional sint64 defaulted_sint64 = 205 [default = -6400]; + optional uint64 defaulted_uint64 = 206 [default = 6400]; + optional fixed32 defaulted_fixed32 = 207 [default = 320000]; + optional sfixed32 defaulted_sfixed32 = 208 [default = -320000]; + optional float defaulted_float = 209 [default = 3.14159]; + optional fixed64 defaulted_fixed64 = 210 [default = 640000]; + optional sfixed64 defaulted_sfixed64 = 211 [default = -640000]; + optional double defaulted_double = 212 [default = 3.14159265359]; + optional string defaulted_string = 213 [default = "hello, \"world!\"\n"]; + optional bytes defaulted_bytes = 214 [default = "dead\xde\xad\xbe\xefbeef"]; - optional ChildEnum defaulted_child_enum = 215 [default = ALPHA]; - optional SiblingEnum defaulted_sibling_enum = 216 [default = ALPHA]; + optional ChildEnum defaulted_child_enum = 215 [default = ALPHA]; + optional SiblingEnum defaulted_sibling_enum = 216 [default = ALPHA]; - // Required fields. - required bool required_bool = 300; - required int32 required_int32 = 301; - required sint32 required_sint32 = 302; - required uint32 required_uint32 = 303; - required int64 required_int64 = 304; - required sint64 required_sint64 = 305; - required uint64 required_uint64 = 306; - required fixed32 required_fixed32 = 307; - required sfixed32 required_sfixed32 = 308; - required float required_float = 309; - required fixed64 required_fixed64 = 310; - required sfixed64 required_sfixed64 = 311; - required double required_double = 312; - required string required_string = 313; - required bytes required_bytes = 314; + // Required fields. + required bool required_bool = 300; + required int32 required_int32 = 301; + required sint32 required_sint32 = 302; + required uint32 required_uint32 = 303; + required int64 required_int64 = 304; + required sint64 required_sint64 = 305; + required uint64 required_uint64 = 306; + required fixed32 required_fixed32 = 307; + required sfixed32 required_sfixed32 = 308; + required float required_float = 309; + required fixed64 required_fixed64 = 310; + required sfixed64 required_sfixed64 = 311; + required double required_double = 312; + required string required_string = 313; + required bytes required_bytes = 314; - required ChildEnum required_child_enum = 315; - required ChildMessage required_child_message = 316; - required NamedGroup required_named_group = 317; - required SiblingEnum required_sibling_enum = 318; - required SiblingMessage required_sibling_message = 319; - required group RequiredGroup = 320 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } - // Required default fields. - required bool required_defaulted_bool = 400 [default = true]; - required int32 required_defaulted_int32 = 401 [default = -12345]; - required sint32 required_defaulted_sint32 = 402 [default = -3200]; - required uint32 required_defaulted_uint32 = 403 [default = 3200]; - required int64 required_defaulted_int64 = 404 [default = -123456789]; - required sint64 required_defaulted_sint64 = 405 [default = -6400]; - required uint64 required_defaulted_uint64 = 406 [default = 6400]; - required fixed32 required_defaulted_fixed32 = 407 [default = 320000]; - required sfixed32 required_defaulted_sfixed32 = 408 [default = -320000]; - required float required_defaulted_float = 409 [default = 3.14159]; - required fixed64 required_defaulted_fixed64 = 410 [default = 640000]; - required sfixed64 required_defaulted_sfixed64 = 411 [default = -640000]; - required double required_defaulted_double = 412 [default = 3.14159265359]; - required string required_defaulted_string = 413 [default = "hello, \"world!\"\n"]; - required bytes required_defaulted_bytes = 414 [default = "dead\xde\xad\xbe\xefbeef"]; + required ChildEnum required_child_enum = 315; + required ChildMessage required_child_message = 316; + required NamedGroup required_named_group = 317; + required SiblingEnum required_sibling_enum = 318; + required SiblingMessage required_sibling_message = 319; + required group RequiredGroup = 320 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } + // Required default fields. + required bool required_defaulted_bool = 400 [default = true]; + required int32 required_defaulted_int32 = 401 [default = -12345]; + required sint32 required_defaulted_sint32 = 402 [default = -3200]; + required uint32 required_defaulted_uint32 = 403 [default = 3200]; + required int64 required_defaulted_int64 = 404 [default = -123456789]; + required sint64 required_defaulted_sint64 = 405 [default = -6400]; + required uint64 required_defaulted_uint64 = 406 [default = 6400]; + required fixed32 required_defaulted_fixed32 = 407 [default = 320000]; + required sfixed32 required_defaulted_sfixed32 = 408 [default = -320000]; + required float required_defaulted_float = 409 [default = 3.14159]; + required fixed64 required_defaulted_fixed64 = 410 [default = 640000]; + required sfixed64 required_defaulted_sfixed64 = 411 [default = -640000]; + required double required_defaulted_double = 412 [default = 3.14159265359]; + required string required_defaulted_string = 413 + [default = "hello, \"world!\"\n"]; + required bytes required_defaulted_bytes = 414 + [default = "dead\xde\xad\xbe\xefbeef"]; - required ChildEnum required_defaulted_child_enum = 415 [default = ALPHA]; - required SiblingEnum required_defaulted_sibling_enum = 416 [default = ALPHA]; + required ChildEnum required_defaulted_child_enum = 415 [default = ALPHA]; + required SiblingEnum required_defaulted_sibling_enum = 416 [default = ALPHA]; - // Repeated fields. - repeated bool repeated_bool = 500; - repeated int32 repeated_int32 = 501; - repeated sint32 repeated_sint32 = 502; - repeated uint32 repeated_uint32 = 503; - repeated int64 repeated_int64 = 504; - repeated sint64 repeated_sint64 = 505; - repeated uint64 repeated_uint64 = 506; - repeated fixed32 repeated_fixed32 = 507; - repeated sfixed32 repeated_sfixed32 = 508; - repeated float repeated_float = 509; - repeated fixed64 repeated_fixed64 = 510; - repeated sfixed64 repeated_sfixed64 = 511; - repeated double repeated_double = 512; - repeated string repeated_string = 513; - repeated bytes repeated_bytes = 514; + // Repeated fields. + repeated bool repeated_bool = 500; + repeated int32 repeated_int32 = 501; + repeated sint32 repeated_sint32 = 502; + repeated uint32 repeated_uint32 = 503; + repeated int64 repeated_int64 = 504; + repeated sint64 repeated_sint64 = 505; + repeated uint64 repeated_uint64 = 506; + repeated fixed32 repeated_fixed32 = 507; + repeated sfixed32 repeated_sfixed32 = 508; + repeated float repeated_float = 509; + repeated fixed64 repeated_fixed64 = 510; + repeated sfixed64 repeated_sfixed64 = 511; + repeated double repeated_double = 512; + repeated string repeated_string = 513; + repeated bytes repeated_bytes = 514; - repeated ChildEnum repeated_child_enum = 515; - repeated ChildMessage repeated_child_message = 516; - repeated NamedGroup repeated_named_group = 517; - repeated SiblingEnum repeated_sibling_enum = 518; - repeated SiblingMessage repeated_sibling_message = 519; - repeated group RepeatedGroup = 520 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + repeated ChildEnum repeated_child_enum = 515; + repeated ChildMessage repeated_child_message = 516; + repeated NamedGroup repeated_named_group = 517; + repeated SiblingEnum repeated_sibling_enum = 518; + repeated SiblingMessage repeated_sibling_message = 519; + repeated group RepeatedGroup = 520 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Map fields. - map<bool, bool> map_bool_bool = 600; - map<bool, int32> map_bool_int32 = 601; - map<bool, sint32> map_bool_sint32 = 602; - map<bool, uint32> map_bool_uint32 = 603; - map<bool, int64> map_bool_int64 = 604; - map<bool, sint64> map_bool_sint64 = 605; - map<bool, uint64> map_bool_uint64 = 606; - map<bool, fixed32> map_bool_fixed32 = 607; - map<bool, sfixed32> map_bool_sfixed32 = 608; - map<bool, float> map_bool_float = 609; - map<bool, fixed64> map_bool_fixed64 = 610; - map<bool, sfixed64> map_bool_sfixed64 = 611; - map<bool, double> map_bool_double = 612; - map<bool, string> map_bool_string = 613; - map<bool, bytes> map_bool_bytes = 614; + // Map fields. + map<bool, bool> map_bool_bool = 600; + map<bool, int32> map_bool_int32 = 601; + map<bool, sint32> map_bool_sint32 = 602; + map<bool, uint32> map_bool_uint32 = 603; + map<bool, int64> map_bool_int64 = 604; + map<bool, sint64> map_bool_sint64 = 605; + map<bool, uint64> map_bool_uint64 = 606; + map<bool, fixed32> map_bool_fixed32 = 607; + map<bool, sfixed32> map_bool_sfixed32 = 608; + map<bool, float> map_bool_float = 609; + map<bool, fixed64> map_bool_fixed64 = 610; + map<bool, sfixed64> map_bool_sfixed64 = 611; + map<bool, double> map_bool_double = 612; + map<bool, string> map_bool_string = 613; + map<bool, bytes> map_bool_bytes = 614; - map<bool, ChildEnum> map_bool_child_enum = 615; - map<bool, ChildMessage> map_bool_child_message = 616; - map<bool, NamedGroup> map_bool_named_group = 617; - map<bool, SiblingEnum> map_bool_sibling_enum = 618; - map<bool, SiblingMessage> map_bool_sibling_message = 619; + map<bool, ChildEnum> map_bool_child_enum = 615; + map<bool, ChildMessage> map_bool_child_message = 616; + map<bool, NamedGroup> map_bool_named_group = 617; + map<bool, SiblingEnum> map_bool_sibling_enum = 618; + map<bool, SiblingMessage> map_bool_sibling_message = 619; - map<int32, bool> map_int32_bool = 620; - map<sint32, bool> map_sint32_bool = 621; - map<uint32, bool> map_uint32_bool = 622; - map<int64, bool> map_int64_bool = 623; - map<sint64, bool> map_sint64_bool = 624; - map<uint64, bool> map_uint64_bool = 625; - map<fixed32, bool> map_fixed32_bool = 626; - map<string, bool> map_string_bool = 627; + map<int32, bool> map_int32_bool = 620; + map<sint32, bool> map_sint32_bool = 621; + map<uint32, bool> map_uint32_bool = 622; + map<int64, bool> map_int64_bool = 623; + map<sint64, bool> map_sint64_bool = 624; + map<uint64, bool> map_uint64_bool = 625; + map<fixed32, bool> map_fixed32_bool = 626; + map<string, bool> map_string_bool = 627; - // Oneof fields. - oneof oneof_union { - bool oneof_bool = 700; - int32 oneof_int32 = 701; - sint32 oneof_sint32 = 702; - uint32 oneof_uint32 = 703; - int64 oneof_int64 = 704; - sint64 oneof_sint64 = 705; - uint64 oneof_uint64 = 706; - fixed32 oneof_fixed32 = 707; - sfixed32 oneof_sfixed32 = 708; - float oneof_float = 709; - fixed64 oneof_fixed64 = 710; - sfixed64 oneof_sfixed64 = 711; - double oneof_double = 712; - string oneof_string = 713; - bytes oneof_bytes = 714; + // Oneof fields. + oneof oneof_union { + bool oneof_bool = 700; + int32 oneof_int32 = 701; + sint32 oneof_sint32 = 702; + uint32 oneof_uint32 = 703; + int64 oneof_int64 = 704; + sint64 oneof_sint64 = 705; + uint64 oneof_uint64 = 706; + fixed32 oneof_fixed32 = 707; + sfixed32 oneof_sfixed32 = 708; + float oneof_float = 709; + fixed64 oneof_fixed64 = 710; + sfixed64 oneof_sfixed64 = 711; + double oneof_double = 712; + string oneof_string = 713; + bytes oneof_bytes = 714; - ChildEnum oneof_child_enum = 715; - ChildMessage oneof_child_message = 716; - NamedGroup oneof_named_group = 717; - SiblingEnum oneof_sibling_enum = 718; - SiblingMessage oneof_sibling_message = 719; - group OneofGroup = 720 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + ChildEnum oneof_child_enum = 715; + ChildMessage oneof_child_message = 716; + NamedGroup oneof_named_group = 717; + SiblingEnum oneof_sibling_enum = 718; + SiblingMessage oneof_sibling_message = 719; + group OneofGroup = 720 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - string oneof_string1 = 721; - string oneof_string2 = 722; - string oneof_string3 = 723; - } + string oneof_string1 = 721; + string oneof_string2 = 722; + string oneof_string3 = 723; + } - // Oneof default fields. - oneof oneof_defaulted_union { - bool oneof_defaulted_bool = 800 [default = true]; - int32 oneof_defaulted_int32 = 801 [default = -12345]; - sint32 oneof_defaulted_sint32 = 802 [default = -3200]; - uint32 oneof_defaulted_uint32 = 803 [default = 3200]; - int64 oneof_defaulted_int64 = 804 [default = -123456789]; - sint64 oneof_defaulted_sint64 = 805 [default = -6400]; - uint64 oneof_defaulted_uint64 = 806 [default = 6400]; - fixed32 oneof_defaulted_fixed32 = 807 [default = 320000]; - sfixed32 oneof_defaulted_sfixed32 = 808 [default = -320000]; - float oneof_defaulted_float = 809 [default = 3.14159]; - fixed64 oneof_defaulted_fixed64 = 810 [default = 640000]; - sfixed64 oneof_defaulted_sfixed64 = 811 [default = -640000]; - double oneof_defaulted_double = 812 [default = 3.14159265359]; - string oneof_defaulted_string = 813 [default = "hello, \"world!\"\n"]; - bytes oneof_defaulted_bytes = 814 [default = "dead\xde\xad\xbe\xefbeef"]; + // Oneof default fields. + oneof oneof_defaulted_union { + bool oneof_defaulted_bool = 800 [default = true]; + int32 oneof_defaulted_int32 = 801 [default = -12345]; + sint32 oneof_defaulted_sint32 = 802 [default = -3200]; + uint32 oneof_defaulted_uint32 = 803 [default = 3200]; + int64 oneof_defaulted_int64 = 804 [default = -123456789]; + sint64 oneof_defaulted_sint64 = 805 [default = -6400]; + uint64 oneof_defaulted_uint64 = 806 [default = 6400]; + fixed32 oneof_defaulted_fixed32 = 807 [default = 320000]; + sfixed32 oneof_defaulted_sfixed32 = 808 [default = -320000]; + float oneof_defaulted_float = 809 [default = 3.14159]; + fixed64 oneof_defaulted_fixed64 = 810 [default = 640000]; + sfixed64 oneof_defaulted_sfixed64 = 811 [default = -640000]; + double oneof_defaulted_double = 812 [default = 3.14159265359]; + string oneof_defaulted_string = 813 [default = "hello, \"world!\"\n"]; + bytes oneof_defaulted_bytes = 814 [default = "dead\xde\xad\xbe\xefbeef"]; - ChildEnum oneof_defaulted_child_enum = 815 [default = ALPHA]; - SiblingEnum oneof_defaulted_sibling_enum = 816 [default = ALPHA]; - } + ChildEnum oneof_defaulted_child_enum = 815 [default = ALPHA]; + SiblingEnum oneof_defaulted_sibling_enum = 816 [default = ALPHA]; + } - // Extension fields. - extend Message { - // Optional fields. - optional bool extension_optional_bool = 10000; - optional int32 extension_optional_int32 = 10001; - optional sint32 extension_optional_sint32 = 10002; - optional uint32 extension_optional_uint32 = 10003; - optional int64 extension_optional_int64 = 10004; - optional sint64 extension_optional_sint64 = 10005; - optional uint64 extension_optional_uint64 = 10006; - optional fixed32 extension_optional_fixed32 = 10007; - optional sfixed32 extension_optional_sfixed32 = 10008; - optional float extension_optional_float = 10009; - optional fixed64 extension_optional_fixed64 = 10010; - optional sfixed64 extension_optional_sfixed64 = 10011; - optional double extension_optional_double = 10012; - optional string extension_optional_string = 10013; - optional bytes extension_optional_bytes = 10014; + // Extension fields. + extend Message { + // Optional fields. + optional bool extension_optional_bool = 10000; + optional int32 extension_optional_int32 = 10001; + optional sint32 extension_optional_sint32 = 10002; + optional uint32 extension_optional_uint32 = 10003; + optional int64 extension_optional_int64 = 10004; + optional sint64 extension_optional_sint64 = 10005; + optional uint64 extension_optional_uint64 = 10006; + optional fixed32 extension_optional_fixed32 = 10007; + optional sfixed32 extension_optional_sfixed32 = 10008; + optional float extension_optional_float = 10009; + optional fixed64 extension_optional_fixed64 = 10010; + optional sfixed64 extension_optional_sfixed64 = 10011; + optional double extension_optional_double = 10012; + optional string extension_optional_string = 10013; + optional bytes extension_optional_bytes = 10014; - optional ChildEnum extension_optional_child_enum = 10015; - optional ChildMessage extension_optional_child_message = 10016; - optional NamedGroup extension_optional_named_group = 10017; - optional SiblingEnum extension_optional_sibling_enum = 10018; - optional SiblingMessage extension_optional_sibling_message = 10019; - optional group ExtensionOptionalGroup = 10020 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + optional ChildEnum extension_optional_child_enum = 10015; + optional ChildMessage extension_optional_child_message = 10016; + optional NamedGroup extension_optional_named_group = 10017; + optional SiblingEnum extension_optional_sibling_enum = 10018; + optional SiblingMessage extension_optional_sibling_message = 10019; + optional group ExtensionOptionalGroup = 10020 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Optional default fields. - optional bool extension_defaulted_bool = 20000 [default = true]; - optional int32 extension_defaulted_int32 = 20001 [default = -12345]; - optional sint32 extension_defaulted_sint32 = 20002 [default = -3200]; - optional uint32 extension_defaulted_uint32 = 20003 [default = 3200]; - optional int64 extension_defaulted_int64 = 20004 [default = -123456789]; - optional sint64 extension_defaulted_sint64 = 20005 [default = -6400]; - optional uint64 extension_defaulted_uint64 = 20006 [default = 6400]; - optional fixed32 extension_defaulted_fixed32 = 20007 [default = 320000]; - optional sfixed32 extension_defaulted_sfixed32 = 20008 [default = -320000]; - optional float extension_defaulted_float = 20009 [default = 3.14159]; - optional fixed64 extension_defaulted_fixed64 = 20010 [default = 640000]; - optional sfixed64 extension_defaulted_sfixed64 = 20011 [default = -640000]; - optional double extension_defaulted_double = 20012 [default = 3.14159265359]; - optional string extension_defaulted_string = 20013 [default = "hello, \"world!\"\n"]; - optional bytes extension_defaulted_bytes = 20014 [default = "dead\xde\xad\xbe\xefbeef"]; + // Optional default fields. + optional bool extension_defaulted_bool = 20000 [default = true]; + optional int32 extension_defaulted_int32 = 20001 [default = -12345]; + optional sint32 extension_defaulted_sint32 = 20002 [default = -3200]; + optional uint32 extension_defaulted_uint32 = 20003 [default = 3200]; + optional int64 extension_defaulted_int64 = 20004 [default = -123456789]; + optional sint64 extension_defaulted_sint64 = 20005 [default = -6400]; + optional uint64 extension_defaulted_uint64 = 20006 [default = 6400]; + optional fixed32 extension_defaulted_fixed32 = 20007 [default = 320000]; + optional sfixed32 extension_defaulted_sfixed32 = 20008 [default = -320000]; + optional float extension_defaulted_float = 20009 [default = 3.14159]; + optional fixed64 extension_defaulted_fixed64 = 20010 [default = 640000]; + optional sfixed64 extension_defaulted_sfixed64 = 20011 [default = -640000]; + optional double extension_defaulted_double = 20012 + [default = 3.14159265359]; + optional string extension_defaulted_string = 20013 + [default = "hello, \"world!\"\n"]; + optional bytes extension_defaulted_bytes = 20014 + [default = "dead\xde\xad\xbe\xefbeef"]; - optional ChildEnum extension_defaulted_child_enum = 20015 [default = ALPHA]; - optional SiblingEnum extension_defaulted_sibling_enum = 20016 [default = ALPHA]; + optional ChildEnum extension_defaulted_child_enum = 20015 [default = ALPHA]; + optional SiblingEnum extension_defaulted_sibling_enum = 20016 + [default = ALPHA]; - // Repeated fields. - repeated bool extension_repeated_bool = 30000; - repeated int32 extension_repeated_int32 = 30001; - repeated sint32 extension_repeated_sint32 = 30002; - repeated uint32 extension_repeated_uint32 = 30003; - repeated int64 extension_repeated_int64 = 30004; - repeated sint64 extension_repeated_sint64 = 30005; - repeated uint64 extension_repeated_uint64 = 30006; - repeated fixed32 extension_repeated_fixed32 = 30007; - repeated sfixed32 extension_repeated_sfixed32 = 30008; - repeated float extension_repeated_float = 30009; - repeated fixed64 extension_repeated_fixed64 = 30010; - repeated sfixed64 extension_repeated_sfixed64 = 30011; - repeated double extension_repeated_double = 30012; - repeated string extension_repeated_string = 30013; - repeated bytes extension_repeated_bytes = 30014; + // Repeated fields. + repeated bool extension_repeated_bool = 30000; + repeated int32 extension_repeated_int32 = 30001; + repeated sint32 extension_repeated_sint32 = 30002; + repeated uint32 extension_repeated_uint32 = 30003; + repeated int64 extension_repeated_int64 = 30004; + repeated sint64 extension_repeated_sint64 = 30005; + repeated uint64 extension_repeated_uint64 = 30006; + repeated fixed32 extension_repeated_fixed32 = 30007; + repeated sfixed32 extension_repeated_sfixed32 = 30008; + repeated float extension_repeated_float = 30009; + repeated fixed64 extension_repeated_fixed64 = 30010; + repeated sfixed64 extension_repeated_sfixed64 = 30011; + repeated double extension_repeated_double = 30012; + repeated string extension_repeated_string = 30013; + repeated bytes extension_repeated_bytes = 30014; - repeated ChildEnum extension_repeated_child_enum = 30015; - repeated ChildMessage extension_repeated_child_message = 30016; - repeated NamedGroup extension_repeated_named_group = 30017; - repeated SiblingEnum extension_repeated_sibling_enum = 30018; - repeated SiblingMessage extension_repeated_sibling_message = 30019; - repeated group ExtensionRepeatedGroup = 30020 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } - } + repeated ChildEnum extension_repeated_child_enum = 30015; + repeated ChildMessage extension_repeated_child_message = 30016; + repeated NamedGroup extension_repeated_named_group = 30017; + repeated SiblingEnum extension_repeated_sibling_enum = 30018; + repeated SiblingMessage extension_repeated_sibling_message = 30019; + repeated group ExtensionRepeatedGroup = 30020 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } + } - extensions 10000 to max; + extensions 10000 to max; } diff --git a/internal/testprotos/legacy/proto2_20180814_aa810b61/test.proto b/internal/testprotos/legacy/proto2_20180814_aa810b61/test.proto index b64ba1f1..bf133d58 100644 --- a/internal/testprotos/legacy/proto2_20180814_aa810b61/test.proto +++ b/internal/testprotos/legacy/proto2_20180814_aa810b61/test.proto @@ -5,329 +5,336 @@ syntax = "proto2"; package google.golang.org.proto2_20180814; + option go_package = "google.golang.org/protobuf/internal/testprotos/legacy/proto2_20180814_aa810b61"; enum SiblingEnum { - ALPHA = 0; - BRAVO = 10; - CHARLIE = 200; + ALPHA = 0; + BRAVO = 10; + CHARLIE = 200; } message SiblingMessage { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; } message Message { - enum ChildEnum { - ALPHA = 0; - BRAVO = 1; - CHARLIE = 2; - } - message ChildMessage { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; - } - optional group NamedGroup = 1 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; - } + enum ChildEnum { + ALPHA = 0; + BRAVO = 1; + CHARLIE = 2; + } + message ChildMessage { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; + } + optional group NamedGroup = 1 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; + } - // Optional fields. - optional bool optional_bool = 100; - optional int32 optional_int32 = 101; - optional sint32 optional_sint32 = 102; - optional uint32 optional_uint32 = 103; - optional int64 optional_int64 = 104; - optional sint64 optional_sint64 = 105; - optional uint64 optional_uint64 = 106; - optional fixed32 optional_fixed32 = 107; - optional sfixed32 optional_sfixed32 = 108; - optional float optional_float = 109; - optional fixed64 optional_fixed64 = 110; - optional sfixed64 optional_sfixed64 = 111; - optional double optional_double = 112; - optional string optional_string = 113; - optional bytes optional_bytes = 114; + // Optional fields. + optional bool optional_bool = 100; + optional int32 optional_int32 = 101; + optional sint32 optional_sint32 = 102; + optional uint32 optional_uint32 = 103; + optional int64 optional_int64 = 104; + optional sint64 optional_sint64 = 105; + optional uint64 optional_uint64 = 106; + optional fixed32 optional_fixed32 = 107; + optional sfixed32 optional_sfixed32 = 108; + optional float optional_float = 109; + optional fixed64 optional_fixed64 = 110; + optional sfixed64 optional_sfixed64 = 111; + optional double optional_double = 112; + optional string optional_string = 113; + optional bytes optional_bytes = 114; - optional ChildEnum optional_child_enum = 115; - optional ChildMessage optional_child_message = 116; - optional NamedGroup optional_named_group = 117; - optional SiblingEnum optional_sibling_enum = 118; - optional SiblingMessage optional_sibling_message = 119; - optional group OptionalGroup = 120 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + optional ChildEnum optional_child_enum = 115; + optional ChildMessage optional_child_message = 116; + optional NamedGroup optional_named_group = 117; + optional SiblingEnum optional_sibling_enum = 118; + optional SiblingMessage optional_sibling_message = 119; + optional group OptionalGroup = 120 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Optional default fields. - optional bool defaulted_bool = 200 [default = true]; - optional int32 defaulted_int32 = 201 [default = -12345]; - optional sint32 defaulted_sint32 = 202 [default = -3200]; - optional uint32 defaulted_uint32 = 203 [default = 3200]; - optional int64 defaulted_int64 = 204 [default = -123456789]; - optional sint64 defaulted_sint64 = 205 [default = -6400]; - optional uint64 defaulted_uint64 = 206 [default = 6400]; - optional fixed32 defaulted_fixed32 = 207 [default = 320000]; - optional sfixed32 defaulted_sfixed32 = 208 [default = -320000]; - optional float defaulted_float = 209 [default = 3.14159]; - optional fixed64 defaulted_fixed64 = 210 [default = 640000]; - optional sfixed64 defaulted_sfixed64 = 211 [default = -640000]; - optional double defaulted_double = 212 [default = 3.14159265359]; - optional string defaulted_string = 213 [default = "hello, \"world!\"\n"]; - optional bytes defaulted_bytes = 214 [default = "dead\xde\xad\xbe\xefbeef"]; + // Optional default fields. + optional bool defaulted_bool = 200 [default = true]; + optional int32 defaulted_int32 = 201 [default = -12345]; + optional sint32 defaulted_sint32 = 202 [default = -3200]; + optional uint32 defaulted_uint32 = 203 [default = 3200]; + optional int64 defaulted_int64 = 204 [default = -123456789]; + optional sint64 defaulted_sint64 = 205 [default = -6400]; + optional uint64 defaulted_uint64 = 206 [default = 6400]; + optional fixed32 defaulted_fixed32 = 207 [default = 320000]; + optional sfixed32 defaulted_sfixed32 = 208 [default = -320000]; + optional float defaulted_float = 209 [default = 3.14159]; + optional fixed64 defaulted_fixed64 = 210 [default = 640000]; + optional sfixed64 defaulted_sfixed64 = 211 [default = -640000]; + optional double defaulted_double = 212 [default = 3.14159265359]; + optional string defaulted_string = 213 [default = "hello, \"world!\"\n"]; + optional bytes defaulted_bytes = 214 [default = "dead\xde\xad\xbe\xefbeef"]; - optional ChildEnum defaulted_child_enum = 215 [default = ALPHA]; - optional SiblingEnum defaulted_sibling_enum = 216 [default = ALPHA]; + optional ChildEnum defaulted_child_enum = 215 [default = ALPHA]; + optional SiblingEnum defaulted_sibling_enum = 216 [default = ALPHA]; - // Required fields. - required bool required_bool = 300; - required int32 required_int32 = 301; - required sint32 required_sint32 = 302; - required uint32 required_uint32 = 303; - required int64 required_int64 = 304; - required sint64 required_sint64 = 305; - required uint64 required_uint64 = 306; - required fixed32 required_fixed32 = 307; - required sfixed32 required_sfixed32 = 308; - required float required_float = 309; - required fixed64 required_fixed64 = 310; - required sfixed64 required_sfixed64 = 311; - required double required_double = 312; - required string required_string = 313; - required bytes required_bytes = 314; + // Required fields. + required bool required_bool = 300; + required int32 required_int32 = 301; + required sint32 required_sint32 = 302; + required uint32 required_uint32 = 303; + required int64 required_int64 = 304; + required sint64 required_sint64 = 305; + required uint64 required_uint64 = 306; + required fixed32 required_fixed32 = 307; + required sfixed32 required_sfixed32 = 308; + required float required_float = 309; + required fixed64 required_fixed64 = 310; + required sfixed64 required_sfixed64 = 311; + required double required_double = 312; + required string required_string = 313; + required bytes required_bytes = 314; - required ChildEnum required_child_enum = 315; - required ChildMessage required_child_message = 316; - required NamedGroup required_named_group = 317; - required SiblingEnum required_sibling_enum = 318; - required SiblingMessage required_sibling_message = 319; - required group RequiredGroup = 320 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } - // Required default fields. - required bool required_defaulted_bool = 400 [default = true]; - required int32 required_defaulted_int32 = 401 [default = -12345]; - required sint32 required_defaulted_sint32 = 402 [default = -3200]; - required uint32 required_defaulted_uint32 = 403 [default = 3200]; - required int64 required_defaulted_int64 = 404 [default = -123456789]; - required sint64 required_defaulted_sint64 = 405 [default = -6400]; - required uint64 required_defaulted_uint64 = 406 [default = 6400]; - required fixed32 required_defaulted_fixed32 = 407 [default = 320000]; - required sfixed32 required_defaulted_sfixed32 = 408 [default = -320000]; - required float required_defaulted_float = 409 [default = 3.14159]; - required fixed64 required_defaulted_fixed64 = 410 [default = 640000]; - required sfixed64 required_defaulted_sfixed64 = 411 [default = -640000]; - required double required_defaulted_double = 412 [default = 3.14159265359]; - required string required_defaulted_string = 413 [default = "hello, \"world!\"\n"]; - required bytes required_defaulted_bytes = 414 [default = "dead\xde\xad\xbe\xefbeef"]; + required ChildEnum required_child_enum = 315; + required ChildMessage required_child_message = 316; + required NamedGroup required_named_group = 317; + required SiblingEnum required_sibling_enum = 318; + required SiblingMessage required_sibling_message = 319; + required group RequiredGroup = 320 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } + // Required default fields. + required bool required_defaulted_bool = 400 [default = true]; + required int32 required_defaulted_int32 = 401 [default = -12345]; + required sint32 required_defaulted_sint32 = 402 [default = -3200]; + required uint32 required_defaulted_uint32 = 403 [default = 3200]; + required int64 required_defaulted_int64 = 404 [default = -123456789]; + required sint64 required_defaulted_sint64 = 405 [default = -6400]; + required uint64 required_defaulted_uint64 = 406 [default = 6400]; + required fixed32 required_defaulted_fixed32 = 407 [default = 320000]; + required sfixed32 required_defaulted_sfixed32 = 408 [default = -320000]; + required float required_defaulted_float = 409 [default = 3.14159]; + required fixed64 required_defaulted_fixed64 = 410 [default = 640000]; + required sfixed64 required_defaulted_sfixed64 = 411 [default = -640000]; + required double required_defaulted_double = 412 [default = 3.14159265359]; + required string required_defaulted_string = 413 + [default = "hello, \"world!\"\n"]; + required bytes required_defaulted_bytes = 414 + [default = "dead\xde\xad\xbe\xefbeef"]; - required ChildEnum required_defaulted_child_enum = 415 [default = ALPHA]; - required SiblingEnum required_defaulted_sibling_enum = 416 [default = ALPHA]; + required ChildEnum required_defaulted_child_enum = 415 [default = ALPHA]; + required SiblingEnum required_defaulted_sibling_enum = 416 [default = ALPHA]; - // Repeated fields. - repeated bool repeated_bool = 500; - repeated int32 repeated_int32 = 501; - repeated sint32 repeated_sint32 = 502; - repeated uint32 repeated_uint32 = 503; - repeated int64 repeated_int64 = 504; - repeated sint64 repeated_sint64 = 505; - repeated uint64 repeated_uint64 = 506; - repeated fixed32 repeated_fixed32 = 507; - repeated sfixed32 repeated_sfixed32 = 508; - repeated float repeated_float = 509; - repeated fixed64 repeated_fixed64 = 510; - repeated sfixed64 repeated_sfixed64 = 511; - repeated double repeated_double = 512; - repeated string repeated_string = 513; - repeated bytes repeated_bytes = 514; + // Repeated fields. + repeated bool repeated_bool = 500; + repeated int32 repeated_int32 = 501; + repeated sint32 repeated_sint32 = 502; + repeated uint32 repeated_uint32 = 503; + repeated int64 repeated_int64 = 504; + repeated sint64 repeated_sint64 = 505; + repeated uint64 repeated_uint64 = 506; + repeated fixed32 repeated_fixed32 = 507; + repeated sfixed32 repeated_sfixed32 = 508; + repeated float repeated_float = 509; + repeated fixed64 repeated_fixed64 = 510; + repeated sfixed64 repeated_sfixed64 = 511; + repeated double repeated_double = 512; + repeated string repeated_string = 513; + repeated bytes repeated_bytes = 514; - repeated ChildEnum repeated_child_enum = 515; - repeated ChildMessage repeated_child_message = 516; - repeated NamedGroup repeated_named_group = 517; - repeated SiblingEnum repeated_sibling_enum = 518; - repeated SiblingMessage repeated_sibling_message = 519; - repeated group RepeatedGroup = 520 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + repeated ChildEnum repeated_child_enum = 515; + repeated ChildMessage repeated_child_message = 516; + repeated NamedGroup repeated_named_group = 517; + repeated SiblingEnum repeated_sibling_enum = 518; + repeated SiblingMessage repeated_sibling_message = 519; + repeated group RepeatedGroup = 520 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Map fields. - map<bool, bool> map_bool_bool = 600; - map<bool, int32> map_bool_int32 = 601; - map<bool, sint32> map_bool_sint32 = 602; - map<bool, uint32> map_bool_uint32 = 603; - map<bool, int64> map_bool_int64 = 604; - map<bool, sint64> map_bool_sint64 = 605; - map<bool, uint64> map_bool_uint64 = 606; - map<bool, fixed32> map_bool_fixed32 = 607; - map<bool, sfixed32> map_bool_sfixed32 = 608; - map<bool, float> map_bool_float = 609; - map<bool, fixed64> map_bool_fixed64 = 610; - map<bool, sfixed64> map_bool_sfixed64 = 611; - map<bool, double> map_bool_double = 612; - map<bool, string> map_bool_string = 613; - map<bool, bytes> map_bool_bytes = 614; + // Map fields. + map<bool, bool> map_bool_bool = 600; + map<bool, int32> map_bool_int32 = 601; + map<bool, sint32> map_bool_sint32 = 602; + map<bool, uint32> map_bool_uint32 = 603; + map<bool, int64> map_bool_int64 = 604; + map<bool, sint64> map_bool_sint64 = 605; + map<bool, uint64> map_bool_uint64 = 606; + map<bool, fixed32> map_bool_fixed32 = 607; + map<bool, sfixed32> map_bool_sfixed32 = 608; + map<bool, float> map_bool_float = 609; + map<bool, fixed64> map_bool_fixed64 = 610; + map<bool, sfixed64> map_bool_sfixed64 = 611; + map<bool, double> map_bool_double = 612; + map<bool, string> map_bool_string = 613; + map<bool, bytes> map_bool_bytes = 614; - map<bool, ChildEnum> map_bool_child_enum = 615; - map<bool, ChildMessage> map_bool_child_message = 616; - map<bool, NamedGroup> map_bool_named_group = 617; - map<bool, SiblingEnum> map_bool_sibling_enum = 618; - map<bool, SiblingMessage> map_bool_sibling_message = 619; + map<bool, ChildEnum> map_bool_child_enum = 615; + map<bool, ChildMessage> map_bool_child_message = 616; + map<bool, NamedGroup> map_bool_named_group = 617; + map<bool, SiblingEnum> map_bool_sibling_enum = 618; + map<bool, SiblingMessage> map_bool_sibling_message = 619; - map<int32, bool> map_int32_bool = 620; - map<sint32, bool> map_sint32_bool = 621; - map<uint32, bool> map_uint32_bool = 622; - map<int64, bool> map_int64_bool = 623; - map<sint64, bool> map_sint64_bool = 624; - map<uint64, bool> map_uint64_bool = 625; - map<fixed32, bool> map_fixed32_bool = 626; - map<string, bool> map_string_bool = 627; + map<int32, bool> map_int32_bool = 620; + map<sint32, bool> map_sint32_bool = 621; + map<uint32, bool> map_uint32_bool = 622; + map<int64, bool> map_int64_bool = 623; + map<sint64, bool> map_sint64_bool = 624; + map<uint64, bool> map_uint64_bool = 625; + map<fixed32, bool> map_fixed32_bool = 626; + map<string, bool> map_string_bool = 627; - // Oneof fields. - oneof oneof_union { - bool oneof_bool = 700; - int32 oneof_int32 = 701; - sint32 oneof_sint32 = 702; - uint32 oneof_uint32 = 703; - int64 oneof_int64 = 704; - sint64 oneof_sint64 = 705; - uint64 oneof_uint64 = 706; - fixed32 oneof_fixed32 = 707; - sfixed32 oneof_sfixed32 = 708; - float oneof_float = 709; - fixed64 oneof_fixed64 = 710; - sfixed64 oneof_sfixed64 = 711; - double oneof_double = 712; - string oneof_string = 713; - bytes oneof_bytes = 714; + // Oneof fields. + oneof oneof_union { + bool oneof_bool = 700; + int32 oneof_int32 = 701; + sint32 oneof_sint32 = 702; + uint32 oneof_uint32 = 703; + int64 oneof_int64 = 704; + sint64 oneof_sint64 = 705; + uint64 oneof_uint64 = 706; + fixed32 oneof_fixed32 = 707; + sfixed32 oneof_sfixed32 = 708; + float oneof_float = 709; + fixed64 oneof_fixed64 = 710; + sfixed64 oneof_sfixed64 = 711; + double oneof_double = 712; + string oneof_string = 713; + bytes oneof_bytes = 714; - ChildEnum oneof_child_enum = 715; - ChildMessage oneof_child_message = 716; - NamedGroup oneof_named_group = 717; - SiblingEnum oneof_sibling_enum = 718; - SiblingMessage oneof_sibling_message = 719; - group OneofGroup = 720 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + ChildEnum oneof_child_enum = 715; + ChildMessage oneof_child_message = 716; + NamedGroup oneof_named_group = 717; + SiblingEnum oneof_sibling_enum = 718; + SiblingMessage oneof_sibling_message = 719; + group OneofGroup = 720 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - string oneof_string1 = 721; - string oneof_string2 = 722; - string oneof_string3 = 723; - } + string oneof_string1 = 721; + string oneof_string2 = 722; + string oneof_string3 = 723; + } - // Oneof default fields. - oneof oneof_defaulted_union { - bool oneof_defaulted_bool = 800 [default = true]; - int32 oneof_defaulted_int32 = 801 [default = -12345]; - sint32 oneof_defaulted_sint32 = 802 [default = -3200]; - uint32 oneof_defaulted_uint32 = 803 [default = 3200]; - int64 oneof_defaulted_int64 = 804 [default = -123456789]; - sint64 oneof_defaulted_sint64 = 805 [default = -6400]; - uint64 oneof_defaulted_uint64 = 806 [default = 6400]; - fixed32 oneof_defaulted_fixed32 = 807 [default = 320000]; - sfixed32 oneof_defaulted_sfixed32 = 808 [default = -320000]; - float oneof_defaulted_float = 809 [default = 3.14159]; - fixed64 oneof_defaulted_fixed64 = 810 [default = 640000]; - sfixed64 oneof_defaulted_sfixed64 = 811 [default = -640000]; - double oneof_defaulted_double = 812 [default = 3.14159265359]; - string oneof_defaulted_string = 813 [default = "hello, \"world!\"\n"]; - bytes oneof_defaulted_bytes = 814 [default = "dead\xde\xad\xbe\xefbeef"]; + // Oneof default fields. + oneof oneof_defaulted_union { + bool oneof_defaulted_bool = 800 [default = true]; + int32 oneof_defaulted_int32 = 801 [default = -12345]; + sint32 oneof_defaulted_sint32 = 802 [default = -3200]; + uint32 oneof_defaulted_uint32 = 803 [default = 3200]; + int64 oneof_defaulted_int64 = 804 [default = -123456789]; + sint64 oneof_defaulted_sint64 = 805 [default = -6400]; + uint64 oneof_defaulted_uint64 = 806 [default = 6400]; + fixed32 oneof_defaulted_fixed32 = 807 [default = 320000]; + sfixed32 oneof_defaulted_sfixed32 = 808 [default = -320000]; + float oneof_defaulted_float = 809 [default = 3.14159]; + fixed64 oneof_defaulted_fixed64 = 810 [default = 640000]; + sfixed64 oneof_defaulted_sfixed64 = 811 [default = -640000]; + double oneof_defaulted_double = 812 [default = 3.14159265359]; + string oneof_defaulted_string = 813 [default = "hello, \"world!\"\n"]; + bytes oneof_defaulted_bytes = 814 [default = "dead\xde\xad\xbe\xefbeef"]; - ChildEnum oneof_defaulted_child_enum = 815 [default = ALPHA]; - SiblingEnum oneof_defaulted_sibling_enum = 816 [default = ALPHA]; - } + ChildEnum oneof_defaulted_child_enum = 815 [default = ALPHA]; + SiblingEnum oneof_defaulted_sibling_enum = 816 [default = ALPHA]; + } - // Extension fields. - extend Message { - // Optional fields. - optional bool extension_optional_bool = 10000; - optional int32 extension_optional_int32 = 10001; - optional sint32 extension_optional_sint32 = 10002; - optional uint32 extension_optional_uint32 = 10003; - optional int64 extension_optional_int64 = 10004; - optional sint64 extension_optional_sint64 = 10005; - optional uint64 extension_optional_uint64 = 10006; - optional fixed32 extension_optional_fixed32 = 10007; - optional sfixed32 extension_optional_sfixed32 = 10008; - optional float extension_optional_float = 10009; - optional fixed64 extension_optional_fixed64 = 10010; - optional sfixed64 extension_optional_sfixed64 = 10011; - optional double extension_optional_double = 10012; - optional string extension_optional_string = 10013; - optional bytes extension_optional_bytes = 10014; + // Extension fields. + extend Message { + // Optional fields. + optional bool extension_optional_bool = 10000; + optional int32 extension_optional_int32 = 10001; + optional sint32 extension_optional_sint32 = 10002; + optional uint32 extension_optional_uint32 = 10003; + optional int64 extension_optional_int64 = 10004; + optional sint64 extension_optional_sint64 = 10005; + optional uint64 extension_optional_uint64 = 10006; + optional fixed32 extension_optional_fixed32 = 10007; + optional sfixed32 extension_optional_sfixed32 = 10008; + optional float extension_optional_float = 10009; + optional fixed64 extension_optional_fixed64 = 10010; + optional sfixed64 extension_optional_sfixed64 = 10011; + optional double extension_optional_double = 10012; + optional string extension_optional_string = 10013; + optional bytes extension_optional_bytes = 10014; - optional ChildEnum extension_optional_child_enum = 10015; - optional ChildMessage extension_optional_child_message = 10016; - optional NamedGroup extension_optional_named_group = 10017; - optional SiblingEnum extension_optional_sibling_enum = 10018; - optional SiblingMessage extension_optional_sibling_message = 10019; - optional group ExtensionOptionalGroup = 10020 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + optional ChildEnum extension_optional_child_enum = 10015; + optional ChildMessage extension_optional_child_message = 10016; + optional NamedGroup extension_optional_named_group = 10017; + optional SiblingEnum extension_optional_sibling_enum = 10018; + optional SiblingMessage extension_optional_sibling_message = 10019; + optional group ExtensionOptionalGroup = 10020 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Optional default fields. - optional bool extension_defaulted_bool = 20000 [default = true]; - optional int32 extension_defaulted_int32 = 20001 [default = -12345]; - optional sint32 extension_defaulted_sint32 = 20002 [default = -3200]; - optional uint32 extension_defaulted_uint32 = 20003 [default = 3200]; - optional int64 extension_defaulted_int64 = 20004 [default = -123456789]; - optional sint64 extension_defaulted_sint64 = 20005 [default = -6400]; - optional uint64 extension_defaulted_uint64 = 20006 [default = 6400]; - optional fixed32 extension_defaulted_fixed32 = 20007 [default = 320000]; - optional sfixed32 extension_defaulted_sfixed32 = 20008 [default = -320000]; - optional float extension_defaulted_float = 20009 [default = 3.14159]; - optional fixed64 extension_defaulted_fixed64 = 20010 [default = 640000]; - optional sfixed64 extension_defaulted_sfixed64 = 20011 [default = -640000]; - optional double extension_defaulted_double = 20012 [default = 3.14159265359]; - optional string extension_defaulted_string = 20013 [default = "hello, \"world!\"\n"]; - optional bytes extension_defaulted_bytes = 20014 [default = "dead\xde\xad\xbe\xefbeef"]; + // Optional default fields. + optional bool extension_defaulted_bool = 20000 [default = true]; + optional int32 extension_defaulted_int32 = 20001 [default = -12345]; + optional sint32 extension_defaulted_sint32 = 20002 [default = -3200]; + optional uint32 extension_defaulted_uint32 = 20003 [default = 3200]; + optional int64 extension_defaulted_int64 = 20004 [default = -123456789]; + optional sint64 extension_defaulted_sint64 = 20005 [default = -6400]; + optional uint64 extension_defaulted_uint64 = 20006 [default = 6400]; + optional fixed32 extension_defaulted_fixed32 = 20007 [default = 320000]; + optional sfixed32 extension_defaulted_sfixed32 = 20008 [default = -320000]; + optional float extension_defaulted_float = 20009 [default = 3.14159]; + optional fixed64 extension_defaulted_fixed64 = 20010 [default = 640000]; + optional sfixed64 extension_defaulted_sfixed64 = 20011 [default = -640000]; + optional double extension_defaulted_double = 20012 + [default = 3.14159265359]; + optional string extension_defaulted_string = 20013 + [default = "hello, \"world!\"\n"]; + optional bytes extension_defaulted_bytes = 20014 + [default = "dead\xde\xad\xbe\xefbeef"]; - optional ChildEnum extension_defaulted_child_enum = 20015 [default = ALPHA]; - optional SiblingEnum extension_defaulted_sibling_enum = 20016 [default = ALPHA]; + optional ChildEnum extension_defaulted_child_enum = 20015 [default = ALPHA]; + optional SiblingEnum extension_defaulted_sibling_enum = 20016 + [default = ALPHA]; - // Repeated fields. - repeated bool extension_repeated_bool = 30000; - repeated int32 extension_repeated_int32 = 30001; - repeated sint32 extension_repeated_sint32 = 30002; - repeated uint32 extension_repeated_uint32 = 30003; - repeated int64 extension_repeated_int64 = 30004; - repeated sint64 extension_repeated_sint64 = 30005; - repeated uint64 extension_repeated_uint64 = 30006; - repeated fixed32 extension_repeated_fixed32 = 30007; - repeated sfixed32 extension_repeated_sfixed32 = 30008; - repeated float extension_repeated_float = 30009; - repeated fixed64 extension_repeated_fixed64 = 30010; - repeated sfixed64 extension_repeated_sfixed64 = 30011; - repeated double extension_repeated_double = 30012; - repeated string extension_repeated_string = 30013; - repeated bytes extension_repeated_bytes = 30014; + // Repeated fields. + repeated bool extension_repeated_bool = 30000; + repeated int32 extension_repeated_int32 = 30001; + repeated sint32 extension_repeated_sint32 = 30002; + repeated uint32 extension_repeated_uint32 = 30003; + repeated int64 extension_repeated_int64 = 30004; + repeated sint64 extension_repeated_sint64 = 30005; + repeated uint64 extension_repeated_uint64 = 30006; + repeated fixed32 extension_repeated_fixed32 = 30007; + repeated sfixed32 extension_repeated_sfixed32 = 30008; + repeated float extension_repeated_float = 30009; + repeated fixed64 extension_repeated_fixed64 = 30010; + repeated sfixed64 extension_repeated_sfixed64 = 30011; + repeated double extension_repeated_double = 30012; + repeated string extension_repeated_string = 30013; + repeated bytes extension_repeated_bytes = 30014; - repeated ChildEnum extension_repeated_child_enum = 30015; - repeated ChildMessage extension_repeated_child_message = 30016; - repeated NamedGroup extension_repeated_named_group = 30017; - repeated SiblingEnum extension_repeated_sibling_enum = 30018; - repeated SiblingMessage extension_repeated_sibling_message = 30019; - repeated group ExtensionRepeatedGroup = 30020 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } - } + repeated ChildEnum extension_repeated_child_enum = 30015; + repeated ChildMessage extension_repeated_child_message = 30016; + repeated NamedGroup extension_repeated_named_group = 30017; + repeated SiblingEnum extension_repeated_sibling_enum = 30018; + repeated SiblingMessage extension_repeated_sibling_message = 30019; + repeated group ExtensionRepeatedGroup = 30020 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } + } - extensions 10000 to max; + extensions 10000 to max; } diff --git a/internal/testprotos/legacy/proto2_20190205_c823c79e/test.proto b/internal/testprotos/legacy/proto2_20190205_c823c79e/test.proto index 4ac2f748..ffe3fab4 100644 --- a/internal/testprotos/legacy/proto2_20190205_c823c79e/test.proto +++ b/internal/testprotos/legacy/proto2_20190205_c823c79e/test.proto @@ -5,329 +5,336 @@ syntax = "proto2"; package google.golang.org.proto2_20190205; + option go_package = "google.golang.org/protobuf/internal/testprotos/legacy/proto2_20190205_c823c79e"; enum SiblingEnum { - ALPHA = 0; - BRAVO = 10; - CHARLIE = 200; + ALPHA = 0; + BRAVO = 10; + CHARLIE = 200; } message SiblingMessage { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; } message Message { - enum ChildEnum { - ALPHA = 0; - BRAVO = 1; - CHARLIE = 2; - } - message ChildMessage { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; - } - optional group NamedGroup = 1 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - optional Message f4 = 4; - } + enum ChildEnum { + ALPHA = 0; + BRAVO = 1; + CHARLIE = 2; + } + message ChildMessage { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; + } + optional group NamedGroup = 1 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + optional Message f4 = 4; + } - // Optional fields. - optional bool optional_bool = 100; - optional int32 optional_int32 = 101; - optional sint32 optional_sint32 = 102; - optional uint32 optional_uint32 = 103; - optional int64 optional_int64 = 104; - optional sint64 optional_sint64 = 105; - optional uint64 optional_uint64 = 106; - optional fixed32 optional_fixed32 = 107; - optional sfixed32 optional_sfixed32 = 108; - optional float optional_float = 109; - optional fixed64 optional_fixed64 = 110; - optional sfixed64 optional_sfixed64 = 111; - optional double optional_double = 112; - optional string optional_string = 113; - optional bytes optional_bytes = 114; + // Optional fields. + optional bool optional_bool = 100; + optional int32 optional_int32 = 101; + optional sint32 optional_sint32 = 102; + optional uint32 optional_uint32 = 103; + optional int64 optional_int64 = 104; + optional sint64 optional_sint64 = 105; + optional uint64 optional_uint64 = 106; + optional fixed32 optional_fixed32 = 107; + optional sfixed32 optional_sfixed32 = 108; + optional float optional_float = 109; + optional fixed64 optional_fixed64 = 110; + optional sfixed64 optional_sfixed64 = 111; + optional double optional_double = 112; + optional string optional_string = 113; + optional bytes optional_bytes = 114; - optional ChildEnum optional_child_enum = 115; - optional ChildMessage optional_child_message = 116; - optional NamedGroup optional_named_group = 117; - optional SiblingEnum optional_sibling_enum = 118; - optional SiblingMessage optional_sibling_message = 119; - optional group OptionalGroup = 120 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + optional ChildEnum optional_child_enum = 115; + optional ChildMessage optional_child_message = 116; + optional NamedGroup optional_named_group = 117; + optional SiblingEnum optional_sibling_enum = 118; + optional SiblingMessage optional_sibling_message = 119; + optional group OptionalGroup = 120 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Optional default fields. - optional bool defaulted_bool = 200 [default = true]; - optional int32 defaulted_int32 = 201 [default = -12345]; - optional sint32 defaulted_sint32 = 202 [default = -3200]; - optional uint32 defaulted_uint32 = 203 [default = 3200]; - optional int64 defaulted_int64 = 204 [default = -123456789]; - optional sint64 defaulted_sint64 = 205 [default = -6400]; - optional uint64 defaulted_uint64 = 206 [default = 6400]; - optional fixed32 defaulted_fixed32 = 207 [default = 320000]; - optional sfixed32 defaulted_sfixed32 = 208 [default = -320000]; - optional float defaulted_float = 209 [default = 3.14159]; - optional fixed64 defaulted_fixed64 = 210 [default = 640000]; - optional sfixed64 defaulted_sfixed64 = 211 [default = -640000]; - optional double defaulted_double = 212 [default = 3.14159265359]; - optional string defaulted_string = 213 [default = "hello, \"world!\"\n"]; - optional bytes defaulted_bytes = 214 [default = "dead\xde\xad\xbe\xefbeef"]; + // Optional default fields. + optional bool defaulted_bool = 200 [default = true]; + optional int32 defaulted_int32 = 201 [default = -12345]; + optional sint32 defaulted_sint32 = 202 [default = -3200]; + optional uint32 defaulted_uint32 = 203 [default = 3200]; + optional int64 defaulted_int64 = 204 [default = -123456789]; + optional sint64 defaulted_sint64 = 205 [default = -6400]; + optional uint64 defaulted_uint64 = 206 [default = 6400]; + optional fixed32 defaulted_fixed32 = 207 [default = 320000]; + optional sfixed32 defaulted_sfixed32 = 208 [default = -320000]; + optional float defaulted_float = 209 [default = 3.14159]; + optional fixed64 defaulted_fixed64 = 210 [default = 640000]; + optional sfixed64 defaulted_sfixed64 = 211 [default = -640000]; + optional double defaulted_double = 212 [default = 3.14159265359]; + optional string defaulted_string = 213 [default = "hello, \"world!\"\n"]; + optional bytes defaulted_bytes = 214 [default = "dead\xde\xad\xbe\xefbeef"]; - optional ChildEnum defaulted_child_enum = 215 [default = ALPHA]; - optional SiblingEnum defaulted_sibling_enum = 216 [default = ALPHA]; + optional ChildEnum defaulted_child_enum = 215 [default = ALPHA]; + optional SiblingEnum defaulted_sibling_enum = 216 [default = ALPHA]; - // Required fields. - required bool required_bool = 300; - required int32 required_int32 = 301; - required sint32 required_sint32 = 302; - required uint32 required_uint32 = 303; - required int64 required_int64 = 304; - required sint64 required_sint64 = 305; - required uint64 required_uint64 = 306; - required fixed32 required_fixed32 = 307; - required sfixed32 required_sfixed32 = 308; - required float required_float = 309; - required fixed64 required_fixed64 = 310; - required sfixed64 required_sfixed64 = 311; - required double required_double = 312; - required string required_string = 313; - required bytes required_bytes = 314; + // Required fields. + required bool required_bool = 300; + required int32 required_int32 = 301; + required sint32 required_sint32 = 302; + required uint32 required_uint32 = 303; + required int64 required_int64 = 304; + required sint64 required_sint64 = 305; + required uint64 required_uint64 = 306; + required fixed32 required_fixed32 = 307; + required sfixed32 required_sfixed32 = 308; + required float required_float = 309; + required fixed64 required_fixed64 = 310; + required sfixed64 required_sfixed64 = 311; + required double required_double = 312; + required string required_string = 313; + required bytes required_bytes = 314; - required ChildEnum required_child_enum = 315; - required ChildMessage required_child_message = 316; - required NamedGroup required_named_group = 317; - required SiblingEnum required_sibling_enum = 318; - required SiblingMessage required_sibling_message = 319; - required group RequiredGroup = 320 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } - // Required default fields. - required bool required_defaulted_bool = 400 [default = true]; - required int32 required_defaulted_int32 = 401 [default = -12345]; - required sint32 required_defaulted_sint32 = 402 [default = -3200]; - required uint32 required_defaulted_uint32 = 403 [default = 3200]; - required int64 required_defaulted_int64 = 404 [default = -123456789]; - required sint64 required_defaulted_sint64 = 405 [default = -6400]; - required uint64 required_defaulted_uint64 = 406 [default = 6400]; - required fixed32 required_defaulted_fixed32 = 407 [default = 320000]; - required sfixed32 required_defaulted_sfixed32 = 408 [default = -320000]; - required float required_defaulted_float = 409 [default = 3.14159]; - required fixed64 required_defaulted_fixed64 = 410 [default = 640000]; - required sfixed64 required_defaulted_sfixed64 = 411 [default = -640000]; - required double required_defaulted_double = 412 [default = 3.14159265359]; - required string required_defaulted_string = 413 [default = "hello, \"world!\"\n"]; - required bytes required_defaulted_bytes = 414 [default = "dead\xde\xad\xbe\xefbeef"]; + required ChildEnum required_child_enum = 315; + required ChildMessage required_child_message = 316; + required NamedGroup required_named_group = 317; + required SiblingEnum required_sibling_enum = 318; + required SiblingMessage required_sibling_message = 319; + required group RequiredGroup = 320 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } + // Required default fields. + required bool required_defaulted_bool = 400 [default = true]; + required int32 required_defaulted_int32 = 401 [default = -12345]; + required sint32 required_defaulted_sint32 = 402 [default = -3200]; + required uint32 required_defaulted_uint32 = 403 [default = 3200]; + required int64 required_defaulted_int64 = 404 [default = -123456789]; + required sint64 required_defaulted_sint64 = 405 [default = -6400]; + required uint64 required_defaulted_uint64 = 406 [default = 6400]; + required fixed32 required_defaulted_fixed32 = 407 [default = 320000]; + required sfixed32 required_defaulted_sfixed32 = 408 [default = -320000]; + required float required_defaulted_float = 409 [default = 3.14159]; + required fixed64 required_defaulted_fixed64 = 410 [default = 640000]; + required sfixed64 required_defaulted_sfixed64 = 411 [default = -640000]; + required double required_defaulted_double = 412 [default = 3.14159265359]; + required string required_defaulted_string = 413 + [default = "hello, \"world!\"\n"]; + required bytes required_defaulted_bytes = 414 + [default = "dead\xde\xad\xbe\xefbeef"]; - required ChildEnum required_defaulted_child_enum = 415 [default = ALPHA]; - required SiblingEnum required_defaulted_sibling_enum = 416 [default = ALPHA]; + required ChildEnum required_defaulted_child_enum = 415 [default = ALPHA]; + required SiblingEnum required_defaulted_sibling_enum = 416 [default = ALPHA]; - // Repeated fields. - repeated bool repeated_bool = 500; - repeated int32 repeated_int32 = 501; - repeated sint32 repeated_sint32 = 502; - repeated uint32 repeated_uint32 = 503; - repeated int64 repeated_int64 = 504; - repeated sint64 repeated_sint64 = 505; - repeated uint64 repeated_uint64 = 506; - repeated fixed32 repeated_fixed32 = 507; - repeated sfixed32 repeated_sfixed32 = 508; - repeated float repeated_float = 509; - repeated fixed64 repeated_fixed64 = 510; - repeated sfixed64 repeated_sfixed64 = 511; - repeated double repeated_double = 512; - repeated string repeated_string = 513; - repeated bytes repeated_bytes = 514; + // Repeated fields. + repeated bool repeated_bool = 500; + repeated int32 repeated_int32 = 501; + repeated sint32 repeated_sint32 = 502; + repeated uint32 repeated_uint32 = 503; + repeated int64 repeated_int64 = 504; + repeated sint64 repeated_sint64 = 505; + repeated uint64 repeated_uint64 = 506; + repeated fixed32 repeated_fixed32 = 507; + repeated sfixed32 repeated_sfixed32 = 508; + repeated float repeated_float = 509; + repeated fixed64 repeated_fixed64 = 510; + repeated sfixed64 repeated_sfixed64 = 511; + repeated double repeated_double = 512; + repeated string repeated_string = 513; + repeated bytes repeated_bytes = 514; - repeated ChildEnum repeated_child_enum = 515; - repeated ChildMessage repeated_child_message = 516; - repeated NamedGroup repeated_named_group = 517; - repeated SiblingEnum repeated_sibling_enum = 518; - repeated SiblingMessage repeated_sibling_message = 519; - repeated group RepeatedGroup = 520 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + repeated ChildEnum repeated_child_enum = 515; + repeated ChildMessage repeated_child_message = 516; + repeated NamedGroup repeated_named_group = 517; + repeated SiblingEnum repeated_sibling_enum = 518; + repeated SiblingMessage repeated_sibling_message = 519; + repeated group RepeatedGroup = 520 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Map fields. - map<bool, bool> map_bool_bool = 600; - map<bool, int32> map_bool_int32 = 601; - map<bool, sint32> map_bool_sint32 = 602; - map<bool, uint32> map_bool_uint32 = 603; - map<bool, int64> map_bool_int64 = 604; - map<bool, sint64> map_bool_sint64 = 605; - map<bool, uint64> map_bool_uint64 = 606; - map<bool, fixed32> map_bool_fixed32 = 607; - map<bool, sfixed32> map_bool_sfixed32 = 608; - map<bool, float> map_bool_float = 609; - map<bool, fixed64> map_bool_fixed64 = 610; - map<bool, sfixed64> map_bool_sfixed64 = 611; - map<bool, double> map_bool_double = 612; - map<bool, string> map_bool_string = 613; - map<bool, bytes> map_bool_bytes = 614; + // Map fields. + map<bool, bool> map_bool_bool = 600; + map<bool, int32> map_bool_int32 = 601; + map<bool, sint32> map_bool_sint32 = 602; + map<bool, uint32> map_bool_uint32 = 603; + map<bool, int64> map_bool_int64 = 604; + map<bool, sint64> map_bool_sint64 = 605; + map<bool, uint64> map_bool_uint64 = 606; + map<bool, fixed32> map_bool_fixed32 = 607; + map<bool, sfixed32> map_bool_sfixed32 = 608; + map<bool, float> map_bool_float = 609; + map<bool, fixed64> map_bool_fixed64 = 610; + map<bool, sfixed64> map_bool_sfixed64 = 611; + map<bool, double> map_bool_double = 612; + map<bool, string> map_bool_string = 613; + map<bool, bytes> map_bool_bytes = 614; - map<bool, ChildEnum> map_bool_child_enum = 615; - map<bool, ChildMessage> map_bool_child_message = 616; - map<bool, NamedGroup> map_bool_named_group = 617; - map<bool, SiblingEnum> map_bool_sibling_enum = 618; - map<bool, SiblingMessage> map_bool_sibling_message = 619; + map<bool, ChildEnum> map_bool_child_enum = 615; + map<bool, ChildMessage> map_bool_child_message = 616; + map<bool, NamedGroup> map_bool_named_group = 617; + map<bool, SiblingEnum> map_bool_sibling_enum = 618; + map<bool, SiblingMessage> map_bool_sibling_message = 619; - map<int32, bool> map_int32_bool = 620; - map<sint32, bool> map_sint32_bool = 621; - map<uint32, bool> map_uint32_bool = 622; - map<int64, bool> map_int64_bool = 623; - map<sint64, bool> map_sint64_bool = 624; - map<uint64, bool> map_uint64_bool = 625; - map<fixed32, bool> map_fixed32_bool = 626; - map<string, bool> map_string_bool = 627; + map<int32, bool> map_int32_bool = 620; + map<sint32, bool> map_sint32_bool = 621; + map<uint32, bool> map_uint32_bool = 622; + map<int64, bool> map_int64_bool = 623; + map<sint64, bool> map_sint64_bool = 624; + map<uint64, bool> map_uint64_bool = 625; + map<fixed32, bool> map_fixed32_bool = 626; + map<string, bool> map_string_bool = 627; - // Oneof fields. - oneof oneof_union { - bool oneof_bool = 700; - int32 oneof_int32 = 701; - sint32 oneof_sint32 = 702; - uint32 oneof_uint32 = 703; - int64 oneof_int64 = 704; - sint64 oneof_sint64 = 705; - uint64 oneof_uint64 = 706; - fixed32 oneof_fixed32 = 707; - sfixed32 oneof_sfixed32 = 708; - float oneof_float = 709; - fixed64 oneof_fixed64 = 710; - sfixed64 oneof_sfixed64 = 711; - double oneof_double = 712; - string oneof_string = 713; - bytes oneof_bytes = 714; + // Oneof fields. + oneof oneof_union { + bool oneof_bool = 700; + int32 oneof_int32 = 701; + sint32 oneof_sint32 = 702; + uint32 oneof_uint32 = 703; + int64 oneof_int64 = 704; + sint64 oneof_sint64 = 705; + uint64 oneof_uint64 = 706; + fixed32 oneof_fixed32 = 707; + sfixed32 oneof_sfixed32 = 708; + float oneof_float = 709; + fixed64 oneof_fixed64 = 710; + sfixed64 oneof_sfixed64 = 711; + double oneof_double = 712; + string oneof_string = 713; + bytes oneof_bytes = 714; - ChildEnum oneof_child_enum = 715; - ChildMessage oneof_child_message = 716; - NamedGroup oneof_named_group = 717; - SiblingEnum oneof_sibling_enum = 718; - SiblingMessage oneof_sibling_message = 719; - group OneofGroup = 720 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + ChildEnum oneof_child_enum = 715; + ChildMessage oneof_child_message = 716; + NamedGroup oneof_named_group = 717; + SiblingEnum oneof_sibling_enum = 718; + SiblingMessage oneof_sibling_message = 719; + group OneofGroup = 720 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - string oneof_string1 = 721; - string oneof_string2 = 722; - string oneof_string3 = 723; - } + string oneof_string1 = 721; + string oneof_string2 = 722; + string oneof_string3 = 723; + } - // Oneof default fields. - oneof oneof_defaulted_union { - bool oneof_defaulted_bool = 800 [default = true]; - int32 oneof_defaulted_int32 = 801 [default = -12345]; - sint32 oneof_defaulted_sint32 = 802 [default = -3200]; - uint32 oneof_defaulted_uint32 = 803 [default = 3200]; - int64 oneof_defaulted_int64 = 804 [default = -123456789]; - sint64 oneof_defaulted_sint64 = 805 [default = -6400]; - uint64 oneof_defaulted_uint64 = 806 [default = 6400]; - fixed32 oneof_defaulted_fixed32 = 807 [default = 320000]; - sfixed32 oneof_defaulted_sfixed32 = 808 [default = -320000]; - float oneof_defaulted_float = 809 [default = 3.14159]; - fixed64 oneof_defaulted_fixed64 = 810 [default = 640000]; - sfixed64 oneof_defaulted_sfixed64 = 811 [default = -640000]; - double oneof_defaulted_double = 812 [default = 3.14159265359]; - string oneof_defaulted_string = 813 [default = "hello, \"world!\"\n"]; - bytes oneof_defaulted_bytes = 814 [default = "dead\xde\xad\xbe\xefbeef"]; + // Oneof default fields. + oneof oneof_defaulted_union { + bool oneof_defaulted_bool = 800 [default = true]; + int32 oneof_defaulted_int32 = 801 [default = -12345]; + sint32 oneof_defaulted_sint32 = 802 [default = -3200]; + uint32 oneof_defaulted_uint32 = 803 [default = 3200]; + int64 oneof_defaulted_int64 = 804 [default = -123456789]; + sint64 oneof_defaulted_sint64 = 805 [default = -6400]; + uint64 oneof_defaulted_uint64 = 806 [default = 6400]; + fixed32 oneof_defaulted_fixed32 = 807 [default = 320000]; + sfixed32 oneof_defaulted_sfixed32 = 808 [default = -320000]; + float oneof_defaulted_float = 809 [default = 3.14159]; + fixed64 oneof_defaulted_fixed64 = 810 [default = 640000]; + sfixed64 oneof_defaulted_sfixed64 = 811 [default = -640000]; + double oneof_defaulted_double = 812 [default = 3.14159265359]; + string oneof_defaulted_string = 813 [default = "hello, \"world!\"\n"]; + bytes oneof_defaulted_bytes = 814 [default = "dead\xde\xad\xbe\xefbeef"]; - ChildEnum oneof_defaulted_child_enum = 815 [default = ALPHA]; - SiblingEnum oneof_defaulted_sibling_enum = 816 [default = ALPHA]; - } + ChildEnum oneof_defaulted_child_enum = 815 [default = ALPHA]; + SiblingEnum oneof_defaulted_sibling_enum = 816 [default = ALPHA]; + } - // Extension fields. - extend Message { - // Optional fields. - optional bool extension_optional_bool = 10000; - optional int32 extension_optional_int32 = 10001; - optional sint32 extension_optional_sint32 = 10002; - optional uint32 extension_optional_uint32 = 10003; - optional int64 extension_optional_int64 = 10004; - optional sint64 extension_optional_sint64 = 10005; - optional uint64 extension_optional_uint64 = 10006; - optional fixed32 extension_optional_fixed32 = 10007; - optional sfixed32 extension_optional_sfixed32 = 10008; - optional float extension_optional_float = 10009; - optional fixed64 extension_optional_fixed64 = 10010; - optional sfixed64 extension_optional_sfixed64 = 10011; - optional double extension_optional_double = 10012; - optional string extension_optional_string = 10013; - optional bytes extension_optional_bytes = 10014; + // Extension fields. + extend Message { + // Optional fields. + optional bool extension_optional_bool = 10000; + optional int32 extension_optional_int32 = 10001; + optional sint32 extension_optional_sint32 = 10002; + optional uint32 extension_optional_uint32 = 10003; + optional int64 extension_optional_int64 = 10004; + optional sint64 extension_optional_sint64 = 10005; + optional uint64 extension_optional_uint64 = 10006; + optional fixed32 extension_optional_fixed32 = 10007; + optional sfixed32 extension_optional_sfixed32 = 10008; + optional float extension_optional_float = 10009; + optional fixed64 extension_optional_fixed64 = 10010; + optional sfixed64 extension_optional_sfixed64 = 10011; + optional double extension_optional_double = 10012; + optional string extension_optional_string = 10013; + optional bytes extension_optional_bytes = 10014; - optional ChildEnum extension_optional_child_enum = 10015; - optional ChildMessage extension_optional_child_message = 10016; - optional NamedGroup extension_optional_named_group = 10017; - optional SiblingEnum extension_optional_sibling_enum = 10018; - optional SiblingMessage extension_optional_sibling_message = 10019; - optional group ExtensionOptionalGroup = 10020 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } + optional ChildEnum extension_optional_child_enum = 10015; + optional ChildMessage extension_optional_child_message = 10016; + optional NamedGroup extension_optional_named_group = 10017; + optional SiblingEnum extension_optional_sibling_enum = 10018; + optional SiblingMessage extension_optional_sibling_message = 10019; + optional group ExtensionOptionalGroup = 10020 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } - // Optional default fields. - optional bool extension_defaulted_bool = 20000 [default = true]; - optional int32 extension_defaulted_int32 = 20001 [default = -12345]; - optional sint32 extension_defaulted_sint32 = 20002 [default = -3200]; - optional uint32 extension_defaulted_uint32 = 20003 [default = 3200]; - optional int64 extension_defaulted_int64 = 20004 [default = -123456789]; - optional sint64 extension_defaulted_sint64 = 20005 [default = -6400]; - optional uint64 extension_defaulted_uint64 = 20006 [default = 6400]; - optional fixed32 extension_defaulted_fixed32 = 20007 [default = 320000]; - optional sfixed32 extension_defaulted_sfixed32 = 20008 [default = -320000]; - optional float extension_defaulted_float = 20009 [default = 3.14159]; - optional fixed64 extension_defaulted_fixed64 = 20010 [default = 640000]; - optional sfixed64 extension_defaulted_sfixed64 = 20011 [default = -640000]; - optional double extension_defaulted_double = 20012 [default = 3.14159265359]; - optional string extension_defaulted_string = 20013 [default = "hello, \"world!\"\n"]; - optional bytes extension_defaulted_bytes = 20014 [default = "dead\xde\xad\xbe\xefbeef"]; + // Optional default fields. + optional bool extension_defaulted_bool = 20000 [default = true]; + optional int32 extension_defaulted_int32 = 20001 [default = -12345]; + optional sint32 extension_defaulted_sint32 = 20002 [default = -3200]; + optional uint32 extension_defaulted_uint32 = 20003 [default = 3200]; + optional int64 extension_defaulted_int64 = 20004 [default = -123456789]; + optional sint64 extension_defaulted_sint64 = 20005 [default = -6400]; + optional uint64 extension_defaulted_uint64 = 20006 [default = 6400]; + optional fixed32 extension_defaulted_fixed32 = 20007 [default = 320000]; + optional sfixed32 extension_defaulted_sfixed32 = 20008 [default = -320000]; + optional float extension_defaulted_float = 20009 [default = 3.14159]; + optional fixed64 extension_defaulted_fixed64 = 20010 [default = 640000]; + optional sfixed64 extension_defaulted_sfixed64 = 20011 [default = -640000]; + optional double extension_defaulted_double = 20012 + [default = 3.14159265359]; + optional string extension_defaulted_string = 20013 + [default = "hello, \"world!\"\n"]; + optional bytes extension_defaulted_bytes = 20014 + [default = "dead\xde\xad\xbe\xefbeef"]; - optional ChildEnum extension_defaulted_child_enum = 20015 [default = ALPHA]; - optional SiblingEnum extension_defaulted_sibling_enum = 20016 [default = ALPHA]; + optional ChildEnum extension_defaulted_child_enum = 20015 [default = ALPHA]; + optional SiblingEnum extension_defaulted_sibling_enum = 20016 + [default = ALPHA]; - // Repeated fields. - repeated bool extension_repeated_bool = 30000; - repeated int32 extension_repeated_int32 = 30001; - repeated sint32 extension_repeated_sint32 = 30002; - repeated uint32 extension_repeated_uint32 = 30003; - repeated int64 extension_repeated_int64 = 30004; - repeated sint64 extension_repeated_sint64 = 30005; - repeated uint64 extension_repeated_uint64 = 30006; - repeated fixed32 extension_repeated_fixed32 = 30007; - repeated sfixed32 extension_repeated_sfixed32 = 30008; - repeated float extension_repeated_float = 30009; - repeated fixed64 extension_repeated_fixed64 = 30010; - repeated sfixed64 extension_repeated_sfixed64 = 30011; - repeated double extension_repeated_double = 30012; - repeated string extension_repeated_string = 30013; - repeated bytes extension_repeated_bytes = 30014; + // Repeated fields. + repeated bool extension_repeated_bool = 30000; + repeated int32 extension_repeated_int32 = 30001; + repeated sint32 extension_repeated_sint32 = 30002; + repeated uint32 extension_repeated_uint32 = 30003; + repeated int64 extension_repeated_int64 = 30004; + repeated sint64 extension_repeated_sint64 = 30005; + repeated uint64 extension_repeated_uint64 = 30006; + repeated fixed32 extension_repeated_fixed32 = 30007; + repeated sfixed32 extension_repeated_sfixed32 = 30008; + repeated float extension_repeated_float = 30009; + repeated fixed64 extension_repeated_fixed64 = 30010; + repeated sfixed64 extension_repeated_sfixed64 = 30011; + repeated double extension_repeated_double = 30012; + repeated string extension_repeated_string = 30013; + repeated bytes extension_repeated_bytes = 30014; - repeated ChildEnum extension_repeated_child_enum = 30015; - repeated ChildMessage extension_repeated_child_message = 30016; - repeated NamedGroup extension_repeated_named_group = 30017; - repeated SiblingEnum extension_repeated_sibling_enum = 30018; - repeated SiblingMessage extension_repeated_sibling_message = 30019; - repeated group ExtensionRepeatedGroup = 30020 { - optional string f1 = 1; - required string f2 = 2; - repeated string f3 = 3; - } - } + repeated ChildEnum extension_repeated_child_enum = 30015; + repeated ChildMessage extension_repeated_child_message = 30016; + repeated NamedGroup extension_repeated_named_group = 30017; + repeated SiblingEnum extension_repeated_sibling_enum = 30018; + repeated SiblingMessage extension_repeated_sibling_message = 30019; + repeated group ExtensionRepeatedGroup = 30020 { + optional string f1 = 1; + required string f2 = 2; + repeated string f3 = 3; + } + } - extensions 10000 to max; + extensions 10000 to max; } diff --git a/internal/testprotos/legacy/proto3_20160225_2fc053c5/test.proto b/internal/testprotos/legacy/proto3_20160225_2fc053c5/test.proto index 7a0a6f2a..dc331cb7 100644 --- a/internal/testprotos/legacy/proto3_20160225_2fc053c5/test.proto +++ b/internal/testprotos/legacy/proto3_20160225_2fc053c5/test.proto @@ -5,132 +5,133 @@ syntax = "proto3"; package google.golang.org.proto3_20160225; + option go_package = "google.golang.org/protobuf/internal/testprotos/legacy/proto3_20160225_2fc053c5"; enum SiblingEnum { - ALPHA = 0; - BRAVO = 10; - CHARLIE = 200; + ALPHA = 0; + BRAVO = 10; + CHARLIE = 200; } message SiblingMessage { - string f1 = 1; - repeated string f2 = 2; - Message f3 = 3; + string f1 = 1; + repeated string f2 = 2; + Message f3 = 3; } message Message { - enum ChildEnum { - ALPHA = 0; - BRAVO = 1; - CHARLIE = 2; - } - message ChildMessage { - string f1 = 1; - repeated string f2 = 2; - Message f3 = 3; - } + enum ChildEnum { + ALPHA = 0; + BRAVO = 1; + CHARLIE = 2; + } + message ChildMessage { + string f1 = 1; + repeated string f2 = 2; + Message f3 = 3; + } - // Optional fields. - bool optional_bool = 100; - int32 optional_int32 = 101; - sint32 optional_sint32 = 102; - uint32 optional_uint32 = 103; - int64 optional_int64 = 104; - sint64 optional_sint64 = 105; - uint64 optional_uint64 = 106; - fixed32 optional_fixed32 = 107; - sfixed32 optional_sfixed32 = 108; - float optional_float = 109; - fixed64 optional_fixed64 = 110; - sfixed64 optional_sfixed64 = 111; - double optional_double = 112; - string optional_string = 113; - bytes optional_bytes = 114; + // Optional fields. + bool optional_bool = 100; + int32 optional_int32 = 101; + sint32 optional_sint32 = 102; + uint32 optional_uint32 = 103; + int64 optional_int64 = 104; + sint64 optional_sint64 = 105; + uint64 optional_uint64 = 106; + fixed32 optional_fixed32 = 107; + sfixed32 optional_sfixed32 = 108; + float optional_float = 109; + fixed64 optional_fixed64 = 110; + sfixed64 optional_sfixed64 = 111; + double optional_double = 112; + string optional_string = 113; + bytes optional_bytes = 114; - ChildEnum optional_child_enum = 115; - ChildMessage optional_child_message = 116; - SiblingEnum optional_sibling_enum = 117; - SiblingMessage optional_sibling_message = 118; + ChildEnum optional_child_enum = 115; + ChildMessage optional_child_message = 116; + SiblingEnum optional_sibling_enum = 117; + SiblingMessage optional_sibling_message = 118; - // Repeated fields. - repeated bool repeated_bool = 200; - repeated int32 repeated_int32 = 201; - repeated sint32 repeated_sint32 = 202; - repeated uint32 repeated_uint32 = 203; - repeated int64 repeated_int64 = 204; - repeated sint64 repeated_sint64 = 205; - repeated uint64 repeated_uint64 = 206; - repeated fixed32 repeated_fixed32 = 207; - repeated sfixed32 repeated_sfixed32 = 208; - repeated float repeated_float = 209; - repeated fixed64 repeated_fixed64 = 210; - repeated sfixed64 repeated_sfixed64 = 211; - repeated double repeated_double = 212; - repeated string repeated_string = 213; - repeated bytes repeated_bytes = 214; + // Repeated fields. + repeated bool repeated_bool = 200; + repeated int32 repeated_int32 = 201; + repeated sint32 repeated_sint32 = 202; + repeated uint32 repeated_uint32 = 203; + repeated int64 repeated_int64 = 204; + repeated sint64 repeated_sint64 = 205; + repeated uint64 repeated_uint64 = 206; + repeated fixed32 repeated_fixed32 = 207; + repeated sfixed32 repeated_sfixed32 = 208; + repeated float repeated_float = 209; + repeated fixed64 repeated_fixed64 = 210; + repeated sfixed64 repeated_sfixed64 = 211; + repeated double repeated_double = 212; + repeated string repeated_string = 213; + repeated bytes repeated_bytes = 214; - repeated ChildEnum repeated_child_enum = 215; - repeated ChildMessage repeated_child_message = 216; - repeated SiblingEnum repeated_sibling_enum = 217; - repeated SiblingMessage repeated_sibling_message = 218; + repeated ChildEnum repeated_child_enum = 215; + repeated ChildMessage repeated_child_message = 216; + repeated SiblingEnum repeated_sibling_enum = 217; + repeated SiblingMessage repeated_sibling_message = 218; - // Map fields. - map<bool, bool> map_bool_bool = 300; - map<bool, int32> map_bool_int32 = 301; - map<bool, sint32> map_bool_sint32 = 302; - map<bool, uint32> map_bool_uint32 = 303; - map<bool, int64> map_bool_int64 = 304; - map<bool, sint64> map_bool_sint64 = 305; - map<bool, uint64> map_bool_uint64 = 306; - map<bool, fixed32> map_bool_fixed32 = 307; - map<bool, sfixed32> map_bool_sfixed32 = 308; - map<bool, float> map_bool_float = 309; - map<bool, fixed64> map_bool_fixed64 = 310; - map<bool, sfixed64> map_bool_sfixed64 = 311; - map<bool, double> map_bool_double = 312; - map<bool, string> map_bool_string = 313; - map<bool, bytes> map_bool_bytes = 314; + // Map fields. + map<bool, bool> map_bool_bool = 300; + map<bool, int32> map_bool_int32 = 301; + map<bool, sint32> map_bool_sint32 = 302; + map<bool, uint32> map_bool_uint32 = 303; + map<bool, int64> map_bool_int64 = 304; + map<bool, sint64> map_bool_sint64 = 305; + map<bool, uint64> map_bool_uint64 = 306; + map<bool, fixed32> map_bool_fixed32 = 307; + map<bool, sfixed32> map_bool_sfixed32 = 308; + map<bool, float> map_bool_float = 309; + map<bool, fixed64> map_bool_fixed64 = 310; + map<bool, sfixed64> map_bool_sfixed64 = 311; + map<bool, double> map_bool_double = 312; + map<bool, string> map_bool_string = 313; + map<bool, bytes> map_bool_bytes = 314; - map<bool, ChildEnum> map_bool_child_enum = 315; - map<bool, ChildMessage> map_bool_child_message = 316; - map<bool, SiblingEnum> map_bool_sibling_enum = 317; - map<bool, SiblingMessage> map_bool_sibling_message = 318; + map<bool, ChildEnum> map_bool_child_enum = 315; + map<bool, ChildMessage> map_bool_child_message = 316; + map<bool, SiblingEnum> map_bool_sibling_enum = 317; + map<bool, SiblingMessage> map_bool_sibling_message = 318; - map<int32, bool> map_int32_bool = 319; - map<sint32, bool> map_sint32_bool = 320; - map<uint32, bool> map_uint32_bool = 321; - map<int64, bool> map_int64_bool = 322; - map<sint64, bool> map_sint64_bool = 323; - map<uint64, bool> map_uint64_bool = 324; - map<fixed32, bool> map_fixed32_bool = 325; - map<string, bool> map_string_bool = 326; + map<int32, bool> map_int32_bool = 319; + map<sint32, bool> map_sint32_bool = 320; + map<uint32, bool> map_uint32_bool = 321; + map<int64, bool> map_int64_bool = 322; + map<sint64, bool> map_sint64_bool = 323; + map<uint64, bool> map_uint64_bool = 324; + map<fixed32, bool> map_fixed32_bool = 325; + map<string, bool> map_string_bool = 326; - // Oneof fields. - oneof oneof_union { - bool oneof_bool = 400; - int32 oneof_int32 = 401; - sint32 oneof_sint32 = 402; - uint32 oneof_uint32 = 403; - int64 oneof_int64 = 404; - sint64 oneof_sint64 = 405; - uint64 oneof_uint64 = 406; - fixed32 oneof_fixed32 = 407; - sfixed32 oneof_sfixed32 = 408; - float oneof_float = 409; - fixed64 oneof_fixed64 = 410; - sfixed64 oneof_sfixed64 = 411; - double oneof_double = 412; - string oneof_string = 413; - bytes oneof_bytes = 414; + // Oneof fields. + oneof oneof_union { + bool oneof_bool = 400; + int32 oneof_int32 = 401; + sint32 oneof_sint32 = 402; + uint32 oneof_uint32 = 403; + int64 oneof_int64 = 404; + sint64 oneof_sint64 = 405; + uint64 oneof_uint64 = 406; + fixed32 oneof_fixed32 = 407; + sfixed32 oneof_sfixed32 = 408; + float oneof_float = 409; + fixed64 oneof_fixed64 = 410; + sfixed64 oneof_sfixed64 = 411; + double oneof_double = 412; + string oneof_string = 413; + bytes oneof_bytes = 414; - ChildEnum oneof_child_enum = 415; - ChildMessage oneof_child_message = 416; - SiblingEnum oneof_sibling_enum = 417; - SiblingMessage oneof_sibling_message = 418; + ChildEnum oneof_child_enum = 415; + ChildMessage oneof_child_message = 416; + SiblingEnum oneof_sibling_enum = 417; + SiblingMessage oneof_sibling_message = 418; - string oneof_string1 = 419; - string oneof_string2 = 420; - string oneof_string3 = 421; - } + string oneof_string1 = 419; + string oneof_string2 = 420; + string oneof_string3 = 421; + } } diff --git a/internal/testprotos/legacy/proto3_20160519_a4ab9ec5/test.proto b/internal/testprotos/legacy/proto3_20160519_a4ab9ec5/test.proto index 6d031a42..f36e0c9f 100644 --- a/internal/testprotos/legacy/proto3_20160519_a4ab9ec5/test.proto +++ b/internal/testprotos/legacy/proto3_20160519_a4ab9ec5/test.proto @@ -5,132 +5,133 @@ syntax = "proto3"; package google.golang.org.proto3_20160519; + option go_package = "google.golang.org/protobuf/internal/testprotos/legacy/proto3_20160519_a4ab9ec5"; enum SiblingEnum { - ALPHA = 0; - BRAVO = 10; - CHARLIE = 200; + ALPHA = 0; + BRAVO = 10; + CHARLIE = 200; } message SiblingMessage { - string f1 = 1; - repeated string f2 = 2; - Message f3 = 3; + string f1 = 1; + repeated string f2 = 2; + Message f3 = 3; } message Message { - enum ChildEnum { - ALPHA = 0; - BRAVO = 1; - CHARLIE = 2; - } - message ChildMessage { - string f1 = 1; - repeated string f2 = 2; - Message f3 = 3; - } + enum ChildEnum { + ALPHA = 0; + BRAVO = 1; + CHARLIE = 2; + } + message ChildMessage { + string f1 = 1; + repeated string f2 = 2; + Message f3 = 3; + } - // Optional fields. - bool optional_bool = 100; - int32 optional_int32 = 101; - sint32 optional_sint32 = 102; - uint32 optional_uint32 = 103; - int64 optional_int64 = 104; - sint64 optional_sint64 = 105; - uint64 optional_uint64 = 106; - fixed32 optional_fixed32 = 107; - sfixed32 optional_sfixed32 = 108; - float optional_float = 109; - fixed64 optional_fixed64 = 110; - sfixed64 optional_sfixed64 = 111; - double optional_double = 112; - string optional_string = 113; - bytes optional_bytes = 114; + // Optional fields. + bool optional_bool = 100; + int32 optional_int32 = 101; + sint32 optional_sint32 = 102; + uint32 optional_uint32 = 103; + int64 optional_int64 = 104; + sint64 optional_sint64 = 105; + uint64 optional_uint64 = 106; + fixed32 optional_fixed32 = 107; + sfixed32 optional_sfixed32 = 108; + float optional_float = 109; + fixed64 optional_fixed64 = 110; + sfixed64 optional_sfixed64 = 111; + double optional_double = 112; + string optional_string = 113; + bytes optional_bytes = 114; - ChildEnum optional_child_enum = 115; - ChildMessage optional_child_message = 116; - SiblingEnum optional_sibling_enum = 117; - SiblingMessage optional_sibling_message = 118; + ChildEnum optional_child_enum = 115; + ChildMessage optional_child_message = 116; + SiblingEnum optional_sibling_enum = 117; + SiblingMessage optional_sibling_message = 118; - // Repeated fields. - repeated bool repeated_bool = 200; - repeated int32 repeated_int32 = 201; - repeated sint32 repeated_sint32 = 202; - repeated uint32 repeated_uint32 = 203; - repeated int64 repeated_int64 = 204; - repeated sint64 repeated_sint64 = 205; - repeated uint64 repeated_uint64 = 206; - repeated fixed32 repeated_fixed32 = 207; - repeated sfixed32 repeated_sfixed32 = 208; - repeated float repeated_float = 209; - repeated fixed64 repeated_fixed64 = 210; - repeated sfixed64 repeated_sfixed64 = 211; - repeated double repeated_double = 212; - repeated string repeated_string = 213; - repeated bytes repeated_bytes = 214; + // Repeated fields. + repeated bool repeated_bool = 200; + repeated int32 repeated_int32 = 201; + repeated sint32 repeated_sint32 = 202; + repeated uint32 repeated_uint32 = 203; + repeated int64 repeated_int64 = 204; + repeated sint64 repeated_sint64 = 205; + repeated uint64 repeated_uint64 = 206; + repeated fixed32 repeated_fixed32 = 207; + repeated sfixed32 repeated_sfixed32 = 208; + repeated float repeated_float = 209; + repeated fixed64 repeated_fixed64 = 210; + repeated sfixed64 repeated_sfixed64 = 211; + repeated double repeated_double = 212; + repeated string repeated_string = 213; + repeated bytes repeated_bytes = 214; - repeated ChildEnum repeated_child_enum = 215; - repeated ChildMessage repeated_child_message = 216; - repeated SiblingEnum repeated_sibling_enum = 217; - repeated SiblingMessage repeated_sibling_message = 218; + repeated ChildEnum repeated_child_enum = 215; + repeated ChildMessage repeated_child_message = 216; + repeated SiblingEnum repeated_sibling_enum = 217; + repeated SiblingMessage repeated_sibling_message = 218; - // Map fields. - map<bool, bool> map_bool_bool = 300; - map<bool, int32> map_bool_int32 = 301; - map<bool, sint32> map_bool_sint32 = 302; - map<bool, uint32> map_bool_uint32 = 303; - map<bool, int64> map_bool_int64 = 304; - map<bool, sint64> map_bool_sint64 = 305; - map<bool, uint64> map_bool_uint64 = 306; - map<bool, fixed32> map_bool_fixed32 = 307; - map<bool, sfixed32> map_bool_sfixed32 = 308; - map<bool, float> map_bool_float = 309; - map<bool, fixed64> map_bool_fixed64 = 310; - map<bool, sfixed64> map_bool_sfixed64 = 311; - map<bool, double> map_bool_double = 312; - map<bool, string> map_bool_string = 313; - map<bool, bytes> map_bool_bytes = 314; + // Map fields. + map<bool, bool> map_bool_bool = 300; + map<bool, int32> map_bool_int32 = 301; + map<bool, sint32> map_bool_sint32 = 302; + map<bool, uint32> map_bool_uint32 = 303; + map<bool, int64> map_bool_int64 = 304; + map<bool, sint64> map_bool_sint64 = 305; + map<bool, uint64> map_bool_uint64 = 306; + map<bool, fixed32> map_bool_fixed32 = 307; + map<bool, sfixed32> map_bool_sfixed32 = 308; + map<bool, float> map_bool_float = 309; + map<bool, fixed64> map_bool_fixed64 = 310; + map<bool, sfixed64> map_bool_sfixed64 = 311; + map<bool, double> map_bool_double = 312; + map<bool, string> map_bool_string = 313; + map<bool, bytes> map_bool_bytes = 314; - map<bool, ChildEnum> map_bool_child_enum = 315; - map<bool, ChildMessage> map_bool_child_message = 316; - map<bool, SiblingEnum> map_bool_sibling_enum = 317; - map<bool, SiblingMessage> map_bool_sibling_message = 318; + map<bool, ChildEnum> map_bool_child_enum = 315; + map<bool, ChildMessage> map_bool_child_message = 316; + map<bool, SiblingEnum> map_bool_sibling_enum = 317; + map<bool, SiblingMessage> map_bool_sibling_message = 318; - map<int32, bool> map_int32_bool = 319; - map<sint32, bool> map_sint32_bool = 320; - map<uint32, bool> map_uint32_bool = 321; - map<int64, bool> map_int64_bool = 322; - map<sint64, bool> map_sint64_bool = 323; - map<uint64, bool> map_uint64_bool = 324; - map<fixed32, bool> map_fixed32_bool = 325; - map<string, bool> map_string_bool = 326; + map<int32, bool> map_int32_bool = 319; + map<sint32, bool> map_sint32_bool = 320; + map<uint32, bool> map_uint32_bool = 321; + map<int64, bool> map_int64_bool = 322; + map<sint64, bool> map_sint64_bool = 323; + map<uint64, bool> map_uint64_bool = 324; + map<fixed32, bool> map_fixed32_bool = 325; + map<string, bool> map_string_bool = 326; - // Oneof fields. - oneof oneof_union { - bool oneof_bool = 400; - int32 oneof_int32 = 401; - sint32 oneof_sint32 = 402; - uint32 oneof_uint32 = 403; - int64 oneof_int64 = 404; - sint64 oneof_sint64 = 405; - uint64 oneof_uint64 = 406; - fixed32 oneof_fixed32 = 407; - sfixed32 oneof_sfixed32 = 408; - float oneof_float = 409; - fixed64 oneof_fixed64 = 410; - sfixed64 oneof_sfixed64 = 411; - double oneof_double = 412; - string oneof_string = 413; - bytes oneof_bytes = 414; + // Oneof fields. + oneof oneof_union { + bool oneof_bool = 400; + int32 oneof_int32 = 401; + sint32 oneof_sint32 = 402; + uint32 oneof_uint32 = 403; + int64 oneof_int64 = 404; + sint64 oneof_sint64 = 405; + uint64 oneof_uint64 = 406; + fixed32 oneof_fixed32 = 407; + sfixed32 oneof_sfixed32 = 408; + float oneof_float = 409; + fixed64 oneof_fixed64 = 410; + sfixed64 oneof_sfixed64 = 411; + double oneof_double = 412; + string oneof_string = 413; + bytes oneof_bytes = 414; - ChildEnum oneof_child_enum = 415; - ChildMessage oneof_child_message = 416; - SiblingEnum oneof_sibling_enum = 417; - SiblingMessage oneof_sibling_message = 418; + ChildEnum oneof_child_enum = 415; + ChildMessage oneof_child_message = 416; + SiblingEnum oneof_sibling_enum = 417; + SiblingMessage oneof_sibling_message = 418; - string oneof_string1 = 419; - string oneof_string2 = 420; - string oneof_string3 = 421; - } + string oneof_string1 = 419; + string oneof_string2 = 420; + string oneof_string3 = 421; + } } diff --git a/internal/testprotos/legacy/proto3_20180125_92554152/test.proto b/internal/testprotos/legacy/proto3_20180125_92554152/test.proto index 63212afc..a2668aa2 100644 --- a/internal/testprotos/legacy/proto3_20180125_92554152/test.proto +++ b/internal/testprotos/legacy/proto3_20180125_92554152/test.proto @@ -5,132 +5,133 @@ syntax = "proto3"; package google.golang.org.proto3_20180125; + option go_package = "google.golang.org/protobuf/internal/testprotos/legacy/proto3_20180125_92554152"; enum SiblingEnum { - ALPHA = 0; - BRAVO = 10; - CHARLIE = 200; + ALPHA = 0; + BRAVO = 10; + CHARLIE = 200; } message SiblingMessage { - string f1 = 1; - repeated string f2 = 2; - Message f3 = 3; + string f1 = 1; + repeated string f2 = 2; + Message f3 = 3; } message Message { - enum ChildEnum { - ALPHA = 0; - BRAVO = 1; - CHARLIE = 2; - } - message ChildMessage { - string f1 = 1; - repeated string f2 = 2; - Message f3 = 3; - } + enum ChildEnum { + ALPHA = 0; + BRAVO = 1; + CHARLIE = 2; + } + message ChildMessage { + string f1 = 1; + repeated string f2 = 2; + Message f3 = 3; + } - // Optional fields. - bool optional_bool = 100; - int32 optional_int32 = 101; - sint32 optional_sint32 = 102; - uint32 optional_uint32 = 103; - int64 optional_int64 = 104; - sint64 optional_sint64 = 105; - uint64 optional_uint64 = 106; - fixed32 optional_fixed32 = 107; - sfixed32 optional_sfixed32 = 108; - float optional_float = 109; - fixed64 optional_fixed64 = 110; - sfixed64 optional_sfixed64 = 111; - double optional_double = 112; - string optional_string = 113; - bytes optional_bytes = 114; + // Optional fields. + bool optional_bool = 100; + int32 optional_int32 = 101; + sint32 optional_sint32 = 102; + uint32 optional_uint32 = 103; + int64 optional_int64 = 104; + sint64 optional_sint64 = 105; + uint64 optional_uint64 = 106; + fixed32 optional_fixed32 = 107; + sfixed32 optional_sfixed32 = 108; + float optional_float = 109; + fixed64 optional_fixed64 = 110; + sfixed64 optional_sfixed64 = 111; + double optional_double = 112; + string optional_string = 113; + bytes optional_bytes = 114; - ChildEnum optional_child_enum = 115; - ChildMessage optional_child_message = 116; - SiblingEnum optional_sibling_enum = 117; - SiblingMessage optional_sibling_message = 118; + ChildEnum optional_child_enum = 115; + ChildMessage optional_child_message = 116; + SiblingEnum optional_sibling_enum = 117; + SiblingMessage optional_sibling_message = 118; - // Repeated fields. - repeated bool repeated_bool = 200; - repeated int32 repeated_int32 = 201; - repeated sint32 repeated_sint32 = 202; - repeated uint32 repeated_uint32 = 203; - repeated int64 repeated_int64 = 204; - repeated sint64 repeated_sint64 = 205; - repeated uint64 repeated_uint64 = 206; - repeated fixed32 repeated_fixed32 = 207; - repeated sfixed32 repeated_sfixed32 = 208; - repeated float repeated_float = 209; - repeated fixed64 repeated_fixed64 = 210; - repeated sfixed64 repeated_sfixed64 = 211; - repeated double repeated_double = 212; - repeated string repeated_string = 213; - repeated bytes repeated_bytes = 214; + // Repeated fields. + repeated bool repeated_bool = 200; + repeated int32 repeated_int32 = 201; + repeated sint32 repeated_sint32 = 202; + repeated uint32 repeated_uint32 = 203; + repeated int64 repeated_int64 = 204; + repeated sint64 repeated_sint64 = 205; + repeated uint64 repeated_uint64 = 206; + repeated fixed32 repeated_fixed32 = 207; + repeated sfixed32 repeated_sfixed32 = 208; + repeated float repeated_float = 209; + repeated fixed64 repeated_fixed64 = 210; + repeated sfixed64 repeated_sfixed64 = 211; + repeated double repeated_double = 212; + repeated string repeated_string = 213; + repeated bytes repeated_bytes = 214; - repeated ChildEnum repeated_child_enum = 215; - repeated ChildMessage repeated_child_message = 216; - repeated SiblingEnum repeated_sibling_enum = 217; - repeated SiblingMessage repeated_sibling_message = 218; + repeated ChildEnum repeated_child_enum = 215; + repeated ChildMessage repeated_child_message = 216; + repeated SiblingEnum repeated_sibling_enum = 217; + repeated SiblingMessage repeated_sibling_message = 218; - // Map fields. - map<bool, bool> map_bool_bool = 300; - map<bool, int32> map_bool_int32 = 301; - map<bool, sint32> map_bool_sint32 = 302; - map<bool, uint32> map_bool_uint32 = 303; - map<bool, int64> map_bool_int64 = 304; - map<bool, sint64> map_bool_sint64 = 305; - map<bool, uint64> map_bool_uint64 = 306; - map<bool, fixed32> map_bool_fixed32 = 307; - map<bool, sfixed32> map_bool_sfixed32 = 308; - map<bool, float> map_bool_float = 309; - map<bool, fixed64> map_bool_fixed64 = 310; - map<bool, sfixed64> map_bool_sfixed64 = 311; - map<bool, double> map_bool_double = 312; - map<bool, string> map_bool_string = 313; - map<bool, bytes> map_bool_bytes = 314; + // Map fields. + map<bool, bool> map_bool_bool = 300; + map<bool, int32> map_bool_int32 = 301; + map<bool, sint32> map_bool_sint32 = 302; + map<bool, uint32> map_bool_uint32 = 303; + map<bool, int64> map_bool_int64 = 304; + map<bool, sint64> map_bool_sint64 = 305; + map<bool, uint64> map_bool_uint64 = 306; + map<bool, fixed32> map_bool_fixed32 = 307; + map<bool, sfixed32> map_bool_sfixed32 = 308; + map<bool, float> map_bool_float = 309; + map<bool, fixed64> map_bool_fixed64 = 310; + map<bool, sfixed64> map_bool_sfixed64 = 311; + map<bool, double> map_bool_double = 312; + map<bool, string> map_bool_string = 313; + map<bool, bytes> map_bool_bytes = 314; - map<bool, ChildEnum> map_bool_child_enum = 315; - map<bool, ChildMessage> map_bool_child_message = 316; - map<bool, SiblingEnum> map_bool_sibling_enum = 317; - map<bool, SiblingMessage> map_bool_sibling_message = 318; + map<bool, ChildEnum> map_bool_child_enum = 315; + map<bool, ChildMessage> map_bool_child_message = 316; + map<bool, SiblingEnum> map_bool_sibling_enum = 317; + map<bool, SiblingMessage> map_bool_sibling_message = 318; - map<int32, bool> map_int32_bool = 319; - map<sint32, bool> map_sint32_bool = 320; - map<uint32, bool> map_uint32_bool = 321; - map<int64, bool> map_int64_bool = 322; - map<sint64, bool> map_sint64_bool = 323; - map<uint64, bool> map_uint64_bool = 324; - map<fixed32, bool> map_fixed32_bool = 325; - map<string, bool> map_string_bool = 326; + map<int32, bool> map_int32_bool = 319; + map<sint32, bool> map_sint32_bool = 320; + map<uint32, bool> map_uint32_bool = 321; + map<int64, bool> map_int64_bool = 322; + map<sint64, bool> map_sint64_bool = 323; + map<uint64, bool> map_uint64_bool = 324; + map<fixed32, bool> map_fixed32_bool = 325; + map<string, bool> map_string_bool = 326; - // Oneof fields. - oneof oneof_union { - bool oneof_bool = 400; - int32 oneof_int32 = 401; - sint32 oneof_sint32 = 402; - uint32 oneof_uint32 = 403; - int64 oneof_int64 = 404; - sint64 oneof_sint64 = 405; - uint64 oneof_uint64 = 406; - fixed32 oneof_fixed32 = 407; - sfixed32 oneof_sfixed32 = 408; - float oneof_float = 409; - fixed64 oneof_fixed64 = 410; - sfixed64 oneof_sfixed64 = 411; - double oneof_double = 412; - string oneof_string = 413; - bytes oneof_bytes = 414; + // Oneof fields. + oneof oneof_union { + bool oneof_bool = 400; + int32 oneof_int32 = 401; + sint32 oneof_sint32 = 402; + uint32 oneof_uint32 = 403; + int64 oneof_int64 = 404; + sint64 oneof_sint64 = 405; + uint64 oneof_uint64 = 406; + fixed32 oneof_fixed32 = 407; + sfixed32 oneof_sfixed32 = 408; + float oneof_float = 409; + fixed64 oneof_fixed64 = 410; + sfixed64 oneof_sfixed64 = 411; + double oneof_double = 412; + string oneof_string = 413; + bytes oneof_bytes = 414; - ChildEnum oneof_child_enum = 415; - ChildMessage oneof_child_message = 416; - SiblingEnum oneof_sibling_enum = 417; - SiblingMessage oneof_sibling_message = 418; + ChildEnum oneof_child_enum = 415; + ChildMessage oneof_child_message = 416; + SiblingEnum oneof_sibling_enum = 417; + SiblingMessage oneof_sibling_message = 418; - string oneof_string1 = 419; - string oneof_string2 = 420; - string oneof_string3 = 421; - } + string oneof_string1 = 419; + string oneof_string2 = 420; + string oneof_string3 = 421; + } } diff --git a/internal/testprotos/legacy/proto3_20180430_b4deda09/test.proto b/internal/testprotos/legacy/proto3_20180430_b4deda09/test.proto index b6a56afb..bbbe0cae 100644 --- a/internal/testprotos/legacy/proto3_20180430_b4deda09/test.proto +++ b/internal/testprotos/legacy/proto3_20180430_b4deda09/test.proto @@ -5,132 +5,133 @@ syntax = "proto3"; package google.golang.org.proto3_20180430; + option go_package = "google.golang.org/protobuf/internal/testprotos/legacy/proto3_20180430_b4deda09"; enum SiblingEnum { - ALPHA = 0; - BRAVO = 10; - CHARLIE = 200; + ALPHA = 0; + BRAVO = 10; + CHARLIE = 200; } message SiblingMessage { - string f1 = 1; - repeated string f2 = 2; - Message f3 = 3; + string f1 = 1; + repeated string f2 = 2; + Message f3 = 3; } message Message { - enum ChildEnum { - ALPHA = 0; - BRAVO = 1; - CHARLIE = 2; - } - message ChildMessage { - string f1 = 1; - repeated string f2 = 2; - Message f3 = 3; - } + enum ChildEnum { + ALPHA = 0; + BRAVO = 1; + CHARLIE = 2; + } + message ChildMessage { + string f1 = 1; + repeated string f2 = 2; + Message f3 = 3; + } - // Optional fields. - bool optional_bool = 100; - int32 optional_int32 = 101; - sint32 optional_sint32 = 102; - uint32 optional_uint32 = 103; - int64 optional_int64 = 104; - sint64 optional_sint64 = 105; - uint64 optional_uint64 = 106; - fixed32 optional_fixed32 = 107; - sfixed32 optional_sfixed32 = 108; - float optional_float = 109; - fixed64 optional_fixed64 = 110; - sfixed64 optional_sfixed64 = 111; - double optional_double = 112; - string optional_string = 113; - bytes optional_bytes = 114; + // Optional fields. + bool optional_bool = 100; + int32 optional_int32 = 101; + sint32 optional_sint32 = 102; + uint32 optional_uint32 = 103; + int64 optional_int64 = 104; + sint64 optional_sint64 = 105; + uint64 optional_uint64 = 106; + fixed32 optional_fixed32 = 107; + sfixed32 optional_sfixed32 = 108; + float optional_float = 109; + fixed64 optional_fixed64 = 110; + sfixed64 optional_sfixed64 = 111; + double optional_double = 112; + string optional_string = 113; + bytes optional_bytes = 114; - ChildEnum optional_child_enum = 115; - ChildMessage optional_child_message = 116; - SiblingEnum optional_sibling_enum = 117; - SiblingMessage optional_sibling_message = 118; + ChildEnum optional_child_enum = 115; + ChildMessage optional_child_message = 116; + SiblingEnum optional_sibling_enum = 117; + SiblingMessage optional_sibling_message = 118; - // Repeated fields. - repeated bool repeated_bool = 200; - repeated int32 repeated_int32 = 201; - repeated sint32 repeated_sint32 = 202; - repeated uint32 repeated_uint32 = 203; - repeated int64 repeated_int64 = 204; - repeated sint64 repeated_sint64 = 205; - repeated uint64 repeated_uint64 = 206; - repeated fixed32 repeated_fixed32 = 207; - repeated sfixed32 repeated_sfixed32 = 208; - repeated float repeated_float = 209; - repeated fixed64 repeated_fixed64 = 210; - repeated sfixed64 repeated_sfixed64 = 211; - repeated double repeated_double = 212; - repeated string repeated_string = 213; - repeated bytes repeated_bytes = 214; + // Repeated fields. + repeated bool repeated_bool = 200; + repeated int32 repeated_int32 = 201; + repeated sint32 repeated_sint32 = 202; + repeated uint32 repeated_uint32 = 203; + repeated int64 repeated_int64 = 204; + repeated sint64 repeated_sint64 = 205; + repeated uint64 repeated_uint64 = 206; + repeated fixed32 repeated_fixed32 = 207; + repeated sfixed32 repeated_sfixed32 = 208; + repeated float repeated_float = 209; + repeated fixed64 repeated_fixed64 = 210; + repeated sfixed64 repeated_sfixed64 = 211; + repeated double repeated_double = 212; + repeated string repeated_string = 213; + repeated bytes repeated_bytes = 214; - repeated ChildEnum repeated_child_enum = 215; - repeated ChildMessage repeated_child_message = 216; - repeated SiblingEnum repeated_sibling_enum = 217; - repeated SiblingMessage repeated_sibling_message = 218; + repeated ChildEnum repeated_child_enum = 215; + repeated ChildMessage repeated_child_message = 216; + repeated SiblingEnum repeated_sibling_enum = 217; + repeated SiblingMessage repeated_sibling_message = 218; - // Map fields. - map<bool, bool> map_bool_bool = 300; - map<bool, int32> map_bool_int32 = 301; - map<bool, sint32> map_bool_sint32 = 302; - map<bool, uint32> map_bool_uint32 = 303; - map<bool, int64> map_bool_int64 = 304; - map<bool, sint64> map_bool_sint64 = 305; - map<bool, uint64> map_bool_uint64 = 306; - map<bool, fixed32> map_bool_fixed32 = 307; - map<bool, sfixed32> map_bool_sfixed32 = 308; - map<bool, float> map_bool_float = 309; - map<bool, fixed64> map_bool_fixed64 = 310; - map<bool, sfixed64> map_bool_sfixed64 = 311; - map<bool, double> map_bool_double = 312; - map<bool, string> map_bool_string = 313; - map<bool, bytes> map_bool_bytes = 314; + // Map fields. + map<bool, bool> map_bool_bool = 300; + map<bool, int32> map_bool_int32 = 301; + map<bool, sint32> map_bool_sint32 = 302; + map<bool, uint32> map_bool_uint32 = 303; + map<bool, int64> map_bool_int64 = 304; + map<bool, sint64> map_bool_sint64 = 305; + map<bool, uint64> map_bool_uint64 = 306; + map<bool, fixed32> map_bool_fixed32 = 307; + map<bool, sfixed32> map_bool_sfixed32 = 308; + map<bool, float> map_bool_float = 309; + map<bool, fixed64> map_bool_fixed64 = 310; + map<bool, sfixed64> map_bool_sfixed64 = 311; + map<bool, double> map_bool_double = 312; + map<bool, string> map_bool_string = 313; + map<bool, bytes> map_bool_bytes = 314; - map<bool, ChildEnum> map_bool_child_enum = 315; - map<bool, ChildMessage> map_bool_child_message = 316; - map<bool, SiblingEnum> map_bool_sibling_enum = 317; - map<bool, SiblingMessage> map_bool_sibling_message = 318; + map<bool, ChildEnum> map_bool_child_enum = 315; + map<bool, ChildMessage> map_bool_child_message = 316; + map<bool, SiblingEnum> map_bool_sibling_enum = 317; + map<bool, SiblingMessage> map_bool_sibling_message = 318; - map<int32, bool> map_int32_bool = 319; - map<sint32, bool> map_sint32_bool = 320; - map<uint32, bool> map_uint32_bool = 321; - map<int64, bool> map_int64_bool = 322; - map<sint64, bool> map_sint64_bool = 323; - map<uint64, bool> map_uint64_bool = 324; - map<fixed32, bool> map_fixed32_bool = 325; - map<string, bool> map_string_bool = 326; + map<int32, bool> map_int32_bool = 319; + map<sint32, bool> map_sint32_bool = 320; + map<uint32, bool> map_uint32_bool = 321; + map<int64, bool> map_int64_bool = 322; + map<sint64, bool> map_sint64_bool = 323; + map<uint64, bool> map_uint64_bool = 324; + map<fixed32, bool> map_fixed32_bool = 325; + map<string, bool> map_string_bool = 326; - // Oneof fields. - oneof oneof_union { - bool oneof_bool = 400; - int32 oneof_int32 = 401; - sint32 oneof_sint32 = 402; - uint32 oneof_uint32 = 403; - int64 oneof_int64 = 404; - sint64 oneof_sint64 = 405; - uint64 oneof_uint64 = 406; - fixed32 oneof_fixed32 = 407; - sfixed32 oneof_sfixed32 = 408; - float oneof_float = 409; - fixed64 oneof_fixed64 = 410; - sfixed64 oneof_sfixed64 = 411; - double oneof_double = 412; - string oneof_string = 413; - bytes oneof_bytes = 414; + // Oneof fields. + oneof oneof_union { + bool oneof_bool = 400; + int32 oneof_int32 = 401; + sint32 oneof_sint32 = 402; + uint32 oneof_uint32 = 403; + int64 oneof_int64 = 404; + sint64 oneof_sint64 = 405; + uint64 oneof_uint64 = 406; + fixed32 oneof_fixed32 = 407; + sfixed32 oneof_sfixed32 = 408; + float oneof_float = 409; + fixed64 oneof_fixed64 = 410; + sfixed64 oneof_sfixed64 = 411; + double oneof_double = 412; + string oneof_string = 413; + bytes oneof_bytes = 414; - ChildEnum oneof_child_enum = 415; - ChildMessage oneof_child_message = 416; - SiblingEnum oneof_sibling_enum = 417; - SiblingMessage oneof_sibling_message = 418; + ChildEnum oneof_child_enum = 415; + ChildMessage oneof_child_message = 416; + SiblingEnum oneof_sibling_enum = 417; + SiblingMessage oneof_sibling_message = 418; - string oneof_string1 = 419; - string oneof_string2 = 420; - string oneof_string3 = 421; - } + string oneof_string1 = 419; + string oneof_string2 = 420; + string oneof_string3 = 421; + } } diff --git a/internal/testprotos/legacy/proto3_20180814_aa810b61/test.proto b/internal/testprotos/legacy/proto3_20180814_aa810b61/test.proto index a278ad19..ba58d180 100644 --- a/internal/testprotos/legacy/proto3_20180814_aa810b61/test.proto +++ b/internal/testprotos/legacy/proto3_20180814_aa810b61/test.proto @@ -5,132 +5,133 @@ syntax = "proto3"; package google.golang.org.proto3_20180814; + option go_package = "google.golang.org/protobuf/internal/testprotos/legacy/proto3_20180814_aa810b61"; enum SiblingEnum { - ALPHA = 0; - BRAVO = 10; - CHARLIE = 200; + ALPHA = 0; + BRAVO = 10; + CHARLIE = 200; } message SiblingMessage { - string f1 = 1; - repeated string f2 = 2; - Message f3 = 3; + string f1 = 1; + repeated string f2 = 2; + Message f3 = 3; } message Message { - enum ChildEnum { - ALPHA = 0; - BRAVO = 1; - CHARLIE = 2; - } - message ChildMessage { - string f1 = 1; - repeated string f2 = 2; - Message f3 = 3; - } + enum ChildEnum { + ALPHA = 0; + BRAVO = 1; + CHARLIE = 2; + } + message ChildMessage { + string f1 = 1; + repeated string f2 = 2; + Message f3 = 3; + } - // Optional fields. - bool optional_bool = 100; - int32 optional_int32 = 101; - sint32 optional_sint32 = 102; - uint32 optional_uint32 = 103; - int64 optional_int64 = 104; - sint64 optional_sint64 = 105; - uint64 optional_uint64 = 106; - fixed32 optional_fixed32 = 107; - sfixed32 optional_sfixed32 = 108; - float optional_float = 109; - fixed64 optional_fixed64 = 110; - sfixed64 optional_sfixed64 = 111; - double optional_double = 112; - string optional_string = 113; - bytes optional_bytes = 114; + // Optional fields. + bool optional_bool = 100; + int32 optional_int32 = 101; + sint32 optional_sint32 = 102; + uint32 optional_uint32 = 103; + int64 optional_int64 = 104; + sint64 optional_sint64 = 105; + uint64 optional_uint64 = 106; + fixed32 optional_fixed32 = 107; + sfixed32 optional_sfixed32 = 108; + float optional_float = 109; + fixed64 optional_fixed64 = 110; + sfixed64 optional_sfixed64 = 111; + double optional_double = 112; + string optional_string = 113; + bytes optional_bytes = 114; - ChildEnum optional_child_enum = 115; - ChildMessage optional_child_message = 116; - SiblingEnum optional_sibling_enum = 117; - SiblingMessage optional_sibling_message = 118; + ChildEnum optional_child_enum = 115; + ChildMessage optional_child_message = 116; + SiblingEnum optional_sibling_enum = 117; + SiblingMessage optional_sibling_message = 118; - // Repeated fields. - repeated bool repeated_bool = 200; - repeated int32 repeated_int32 = 201; - repeated sint32 repeated_sint32 = 202; - repeated uint32 repeated_uint32 = 203; - repeated int64 repeated_int64 = 204; - repeated sint64 repeated_sint64 = 205; - repeated uint64 repeated_uint64 = 206; - repeated fixed32 repeated_fixed32 = 207; - repeated sfixed32 repeated_sfixed32 = 208; - repeated float repeated_float = 209; - repeated fixed64 repeated_fixed64 = 210; - repeated sfixed64 repeated_sfixed64 = 211; - repeated double repeated_double = 212; - repeated string repeated_string = 213; - repeated bytes repeated_bytes = 214; + // Repeated fields. + repeated bool repeated_bool = 200; + repeated int32 repeated_int32 = 201; + repeated sint32 repeated_sint32 = 202; + repeated uint32 repeated_uint32 = 203; + repeated int64 repeated_int64 = 204; + repeated sint64 repeated_sint64 = 205; + repeated uint64 repeated_uint64 = 206; + repeated fixed32 repeated_fixed32 = 207; + repeated sfixed32 repeated_sfixed32 = 208; + repeated float repeated_float = 209; + repeated fixed64 repeated_fixed64 = 210; + repeated sfixed64 repeated_sfixed64 = 211; + repeated double repeated_double = 212; + repeated string repeated_string = 213; + repeated bytes repeated_bytes = 214; - repeated ChildEnum repeated_child_enum = 215; - repeated ChildMessage repeated_child_message = 216; - repeated SiblingEnum repeated_sibling_enum = 217; - repeated SiblingMessage repeated_sibling_message = 218; + repeated ChildEnum repeated_child_enum = 215; + repeated ChildMessage repeated_child_message = 216; + repeated SiblingEnum repeated_sibling_enum = 217; + repeated SiblingMessage repeated_sibling_message = 218; - // Map fields. - map<bool, bool> map_bool_bool = 300; - map<bool, int32> map_bool_int32 = 301; - map<bool, sint32> map_bool_sint32 = 302; - map<bool, uint32> map_bool_uint32 = 303; - map<bool, int64> map_bool_int64 = 304; - map<bool, sint64> map_bool_sint64 = 305; - map<bool, uint64> map_bool_uint64 = 306; - map<bool, fixed32> map_bool_fixed32 = 307; - map<bool, sfixed32> map_bool_sfixed32 = 308; - map<bool, float> map_bool_float = 309; - map<bool, fixed64> map_bool_fixed64 = 310; - map<bool, sfixed64> map_bool_sfixed64 = 311; - map<bool, double> map_bool_double = 312; - map<bool, string> map_bool_string = 313; - map<bool, bytes> map_bool_bytes = 314; + // Map fields. + map<bool, bool> map_bool_bool = 300; + map<bool, int32> map_bool_int32 = 301; + map<bool, sint32> map_bool_sint32 = 302; + map<bool, uint32> map_bool_uint32 = 303; + map<bool, int64> map_bool_int64 = 304; + map<bool, sint64> map_bool_sint64 = 305; + map<bool, uint64> map_bool_uint64 = 306; + map<bool, fixed32> map_bool_fixed32 = 307; + map<bool, sfixed32> map_bool_sfixed32 = 308; + map<bool, float> map_bool_float = 309; + map<bool, fixed64> map_bool_fixed64 = 310; + map<bool, sfixed64> map_bool_sfixed64 = 311; + map<bool, double> map_bool_double = 312; + map<bool, string> map_bool_string = 313; + map<bool, bytes> map_bool_bytes = 314; - map<bool, ChildEnum> map_bool_child_enum = 315; - map<bool, ChildMessage> map_bool_child_message = 316; - map<bool, SiblingEnum> map_bool_sibling_enum = 317; - map<bool, SiblingMessage> map_bool_sibling_message = 318; + map<bool, ChildEnum> map_bool_child_enum = 315; + map<bool, ChildMessage> map_bool_child_message = 316; + map<bool, SiblingEnum> map_bool_sibling_enum = 317; + map<bool, SiblingMessage> map_bool_sibling_message = 318; - map<int32, bool> map_int32_bool = 319; - map<sint32, bool> map_sint32_bool = 320; - map<uint32, bool> map_uint32_bool = 321; - map<int64, bool> map_int64_bool = 322; - map<sint64, bool> map_sint64_bool = 323; - map<uint64, bool> map_uint64_bool = 324; - map<fixed32, bool> map_fixed32_bool = 325; - map<string, bool> map_string_bool = 326; + map<int32, bool> map_int32_bool = 319; + map<sint32, bool> map_sint32_bool = 320; + map<uint32, bool> map_uint32_bool = 321; + map<int64, bool> map_int64_bool = 322; + map<sint64, bool> map_sint64_bool = 323; + map<uint64, bool> map_uint64_bool = 324; + map<fixed32, bool> map_fixed32_bool = 325; + map<string, bool> map_string_bool = 326; - // Oneof fields. - oneof oneof_union { - bool oneof_bool = 400; - int32 oneof_int32 = 401; - sint32 oneof_sint32 = 402; - uint32 oneof_uint32 = 403; - int64 oneof_int64 = 404; - sint64 oneof_sint64 = 405; - uint64 oneof_uint64 = 406; - fixed32 oneof_fixed32 = 407; - sfixed32 oneof_sfixed32 = 408; - float oneof_float = 409; - fixed64 oneof_fixed64 = 410; - sfixed64 oneof_sfixed64 = 411; - double oneof_double = 412; - string oneof_string = 413; - bytes oneof_bytes = 414; + // Oneof fields. + oneof oneof_union { + bool oneof_bool = 400; + int32 oneof_int32 = 401; + sint32 oneof_sint32 = 402; + uint32 oneof_uint32 = 403; + int64 oneof_int64 = 404; + sint64 oneof_sint64 = 405; + uint64 oneof_uint64 = 406; + fixed32 oneof_fixed32 = 407; + sfixed32 oneof_sfixed32 = 408; + float oneof_float = 409; + fixed64 oneof_fixed64 = 410; + sfixed64 oneof_sfixed64 = 411; + double oneof_double = 412; + string oneof_string = 413; + bytes oneof_bytes = 414; - ChildEnum oneof_child_enum = 415; - ChildMessage oneof_child_message = 416; - SiblingEnum oneof_sibling_enum = 417; - SiblingMessage oneof_sibling_message = 418; + ChildEnum oneof_child_enum = 415; + ChildMessage oneof_child_message = 416; + SiblingEnum oneof_sibling_enum = 417; + SiblingMessage oneof_sibling_message = 418; - string oneof_string1 = 419; - string oneof_string2 = 420; - string oneof_string3 = 421; - } + string oneof_string1 = 419; + string oneof_string2 = 420; + string oneof_string3 = 421; + } } diff --git a/internal/testprotos/legacy/proto3_20190205_c823c79e/test.proto b/internal/testprotos/legacy/proto3_20190205_c823c79e/test.proto index debdd30e..57ac821d 100644 --- a/internal/testprotos/legacy/proto3_20190205_c823c79e/test.proto +++ b/internal/testprotos/legacy/proto3_20190205_c823c79e/test.proto @@ -5,132 +5,133 @@ syntax = "proto3"; package google.golang.org.proto3_20190205; + option go_package = "google.golang.org/protobuf/internal/testprotos/legacy/proto3_20190205_c823c79e"; enum SiblingEnum { - ALPHA = 0; - BRAVO = 10; - CHARLIE = 200; + ALPHA = 0; + BRAVO = 10; + CHARLIE = 200; } message SiblingMessage { - string f1 = 1; - repeated string f2 = 2; - Message f3 = 3; + string f1 = 1; + repeated string f2 = 2; + Message f3 = 3; } message Message { - enum ChildEnum { - ALPHA = 0; - BRAVO = 1; - CHARLIE = 2; - } - message ChildMessage { - string f1 = 1; - repeated string f2 = 2; - Message f3 = 3; - } + enum ChildEnum { + ALPHA = 0; + BRAVO = 1; + CHARLIE = 2; + } + message ChildMessage { + string f1 = 1; + repeated string f2 = 2; + Message f3 = 3; + } - // Optional fields. - bool optional_bool = 100; - int32 optional_int32 = 101; - sint32 optional_sint32 = 102; - uint32 optional_uint32 = 103; - int64 optional_int64 = 104; - sint64 optional_sint64 = 105; - uint64 optional_uint64 = 106; - fixed32 optional_fixed32 = 107; - sfixed32 optional_sfixed32 = 108; - float optional_float = 109; - fixed64 optional_fixed64 = 110; - sfixed64 optional_sfixed64 = 111; - double optional_double = 112; - string optional_string = 113; - bytes optional_bytes = 114; + // Optional fields. + bool optional_bool = 100; + int32 optional_int32 = 101; + sint32 optional_sint32 = 102; + uint32 optional_uint32 = 103; + int64 optional_int64 = 104; + sint64 optional_sint64 = 105; + uint64 optional_uint64 = 106; + fixed32 optional_fixed32 = 107; + sfixed32 optional_sfixed32 = 108; + float optional_float = 109; + fixed64 optional_fixed64 = 110; + sfixed64 optional_sfixed64 = 111; + double optional_double = 112; + string optional_string = 113; + bytes optional_bytes = 114; - ChildEnum optional_child_enum = 115; - ChildMessage optional_child_message = 116; - SiblingEnum optional_sibling_enum = 117; - SiblingMessage optional_sibling_message = 118; + ChildEnum optional_child_enum = 115; + ChildMessage optional_child_message = 116; + SiblingEnum optional_sibling_enum = 117; + SiblingMessage optional_sibling_message = 118; - // Repeated fields. - repeated bool repeated_bool = 200; - repeated int32 repeated_int32 = 201; - repeated sint32 repeated_sint32 = 202; - repeated uint32 repeated_uint32 = 203; - repeated int64 repeated_int64 = 204; - repeated sint64 repeated_sint64 = 205; - repeated uint64 repeated_uint64 = 206; - repeated fixed32 repeated_fixed32 = 207; - repeated sfixed32 repeated_sfixed32 = 208; - repeated float repeated_float = 209; - repeated fixed64 repeated_fixed64 = 210; - repeated sfixed64 repeated_sfixed64 = 211; - repeated double repeated_double = 212; - repeated string repeated_string = 213; - repeated bytes repeated_bytes = 214; + // Repeated fields. + repeated bool repeated_bool = 200; + repeated int32 repeated_int32 = 201; + repeated sint32 repeated_sint32 = 202; + repeated uint32 repeated_uint32 = 203; + repeated int64 repeated_int64 = 204; + repeated sint64 repeated_sint64 = 205; + repeated uint64 repeated_uint64 = 206; + repeated fixed32 repeated_fixed32 = 207; + repeated sfixed32 repeated_sfixed32 = 208; + repeated float repeated_float = 209; + repeated fixed64 repeated_fixed64 = 210; + repeated sfixed64 repeated_sfixed64 = 211; + repeated double repeated_double = 212; + repeated string repeated_string = 213; + repeated bytes repeated_bytes = 214; - repeated ChildEnum repeated_child_enum = 215; - repeated ChildMessage repeated_child_message = 216; - repeated SiblingEnum repeated_sibling_enum = 217; - repeated SiblingMessage repeated_sibling_message = 218; + repeated ChildEnum repeated_child_enum = 215; + repeated ChildMessage repeated_child_message = 216; + repeated SiblingEnum repeated_sibling_enum = 217; + repeated SiblingMessage repeated_sibling_message = 218; - // Map fields. - map<bool, bool> map_bool_bool = 300; - map<bool, int32> map_bool_int32 = 301; - map<bool, sint32> map_bool_sint32 = 302; - map<bool, uint32> map_bool_uint32 = 303; - map<bool, int64> map_bool_int64 = 304; - map<bool, sint64> map_bool_sint64 = 305; - map<bool, uint64> map_bool_uint64 = 306; - map<bool, fixed32> map_bool_fixed32 = 307; - map<bool, sfixed32> map_bool_sfixed32 = 308; - map<bool, float> map_bool_float = 309; - map<bool, fixed64> map_bool_fixed64 = 310; - map<bool, sfixed64> map_bool_sfixed64 = 311; - map<bool, double> map_bool_double = 312; - map<bool, string> map_bool_string = 313; - map<bool, bytes> map_bool_bytes = 314; + // Map fields. + map<bool, bool> map_bool_bool = 300; + map<bool, int32> map_bool_int32 = 301; + map<bool, sint32> map_bool_sint32 = 302; + map<bool, uint32> map_bool_uint32 = 303; + map<bool, int64> map_bool_int64 = 304; + map<bool, sint64> map_bool_sint64 = 305; + map<bool, uint64> map_bool_uint64 = 306; + map<bool, fixed32> map_bool_fixed32 = 307; + map<bool, sfixed32> map_bool_sfixed32 = 308; + map<bool, float> map_bool_float = 309; + map<bool, fixed64> map_bool_fixed64 = 310; + map<bool, sfixed64> map_bool_sfixed64 = 311; + map<bool, double> map_bool_double = 312; + map<bool, string> map_bool_string = 313; + map<bool, bytes> map_bool_bytes = 314; - map<bool, ChildEnum> map_bool_child_enum = 315; - map<bool, ChildMessage> map_bool_child_message = 316; - map<bool, SiblingEnum> map_bool_sibling_enum = 317; - map<bool, SiblingMessage> map_bool_sibling_message = 318; + map<bool, ChildEnum> map_bool_child_enum = 315; + map<bool, ChildMessage> map_bool_child_message = 316; + map<bool, SiblingEnum> map_bool_sibling_enum = 317; + map<bool, SiblingMessage> map_bool_sibling_message = 318; - map<int32, bool> map_int32_bool = 319; - map<sint32, bool> map_sint32_bool = 320; - map<uint32, bool> map_uint32_bool = 321; - map<int64, bool> map_int64_bool = 322; - map<sint64, bool> map_sint64_bool = 323; - map<uint64, bool> map_uint64_bool = 324; - map<fixed32, bool> map_fixed32_bool = 325; - map<string, bool> map_string_bool = 326; + map<int32, bool> map_int32_bool = 319; + map<sint32, bool> map_sint32_bool = 320; + map<uint32, bool> map_uint32_bool = 321; + map<int64, bool> map_int64_bool = 322; + map<sint64, bool> map_sint64_bool = 323; + map<uint64, bool> map_uint64_bool = 324; + map<fixed32, bool> map_fixed32_bool = 325; + map<string, bool> map_string_bool = 326; - // Oneof fields. - oneof oneof_union { - bool oneof_bool = 400; - int32 oneof_int32 = 401; - sint32 oneof_sint32 = 402; - uint32 oneof_uint32 = 403; - int64 oneof_int64 = 404; - sint64 oneof_sint64 = 405; - uint64 oneof_uint64 = 406; - fixed32 oneof_fixed32 = 407; - sfixed32 oneof_sfixed32 = 408; - float oneof_float = 409; - fixed64 oneof_fixed64 = 410; - sfixed64 oneof_sfixed64 = 411; - double oneof_double = 412; - string oneof_string = 413; - bytes oneof_bytes = 414; + // Oneof fields. + oneof oneof_union { + bool oneof_bool = 400; + int32 oneof_int32 = 401; + sint32 oneof_sint32 = 402; + uint32 oneof_uint32 = 403; + int64 oneof_int64 = 404; + sint64 oneof_sint64 = 405; + uint64 oneof_uint64 = 406; + fixed32 oneof_fixed32 = 407; + sfixed32 oneof_sfixed32 = 408; + float oneof_float = 409; + fixed64 oneof_fixed64 = 410; + sfixed64 oneof_sfixed64 = 411; + double oneof_double = 412; + string oneof_string = 413; + bytes oneof_bytes = 414; - ChildEnum oneof_child_enum = 415; - ChildMessage oneof_child_message = 416; - SiblingEnum oneof_sibling_enum = 417; - SiblingMessage oneof_sibling_message = 418; + ChildEnum oneof_child_enum = 415; + ChildMessage oneof_child_message = 416; + SiblingEnum oneof_sibling_enum = 417; + SiblingMessage oneof_sibling_message = 418; - string oneof_string1 = 419; - string oneof_string2 = 420; - string oneof_string3 = 421; - } + string oneof_string1 = 419; + string oneof_string2 = 420; + string oneof_string3 = 421; + } } diff --git a/internal/testprotos/messageset/messagesetpb/message_set.proto b/internal/testprotos/messageset/messagesetpb/message_set.proto index 4887977b..f16a5cb6 100644 --- a/internal/testprotos/messageset/messagesetpb/message_set.proto +++ b/internal/testprotos/messageset/messagesetpb/message_set.proto @@ -10,6 +10,7 @@ option go_package = "google.golang.org/protobuf/internal/testprotos/messageset/m message MessageSet { option message_set_wire_format = true; + extensions 4 to max; } diff --git a/internal/testprotos/messageset/msetextpb/msetextpb.proto b/internal/testprotos/messageset/msetextpb/msetextpb.proto index 231ded96..cf520c9a 100644 --- a/internal/testprotos/messageset/msetextpb/msetextpb.proto +++ b/internal/testprotos/messageset/msetextpb/msetextpb.proto @@ -6,10 +6,10 @@ syntax = "proto2"; package goproto.proto.messageset; -option go_package = "google.golang.org/protobuf/internal/testprotos/messageset/msetextpb"; - import "internal/testprotos/messageset/messagesetpb/message_set.proto"; +option go_package = "google.golang.org/protobuf/internal/testprotos/messageset/msetextpb"; + message Ext1 { extend MessageSet { optional Ext1 message_set_extension = 1000; @@ -34,6 +34,6 @@ message ExtRequired { message ExtLargeNumber { extend MessageSet { - optional ExtLargeNumber message_set_extension = 536870912; // 1<<29 + optional ExtLargeNumber message_set_extension = 536870912; // 1<<29 } } diff --git a/internal/testprotos/news/news.proto b/internal/testprotos/news/news.proto index bf56f3b8..774c9498 100644 --- a/internal/testprotos/news/news.proto +++ b/internal/testprotos/news/news.proto @@ -12,27 +12,27 @@ import "google/protobuf/timestamp.proto"; option go_package = "google.golang.org/protobuf/internal/testprotos/news"; message Article { - enum Status { - DRAFT = 0; - PUBLISHED = 1; - REVOKED = 2; - } + enum Status { + DRAFT = 0; + PUBLISHED = 1; + REVOKED = 2; + } - string author = 1; - google.protobuf.Timestamp date = 2; - string title = 3; - string content = 4; - Status status = 8; - repeated string tags = 7; - repeated google.protobuf.Any attachments = 6; + string author = 1; + google.protobuf.Timestamp date = 2; + string title = 3; + string content = 4; + Status status = 8; + repeated string tags = 7; + repeated google.protobuf.Any attachments = 6; } message BinaryAttachment { - string name = 1; - bytes data = 2; + string name = 1; + bytes data = 2; } message KeyValueAttachment { - string name = 1; - map<string, string> data = 2; -} \ No newline at end of file + string name = 1; + map<string, string> data = 2; +} diff --git a/internal/testprotos/registry/test.proto b/internal/testprotos/registry/test.proto index 32452b06..39e03056 100644 --- a/internal/testprotos/registry/test.proto +++ b/internal/testprotos/registry/test.proto @@ -6,6 +6,7 @@ syntax = "proto2"; package testprotos; + option go_package = "google.golang.org/protobuf/internal/testprotos/registry"; message Message1 { diff --git a/internal/testprotos/required/required.proto b/internal/testprotos/required/required.proto index 53c41981..2837008e 100644 --- a/internal/testprotos/required/required.proto +++ b/internal/testprotos/required/required.proto @@ -13,51 +13,51 @@ message Int32 { } message Int64 { - required int64 v = 1; + required int64 v = 1; } message Uint32 { - required uint32 v = 1; + required uint32 v = 1; } message Uint64 { - required uint64 v = 1; + required uint64 v = 1; } message Sint32 { - required sint32 v = 1; + required sint32 v = 1; } message Sint64 { - required sint64 v = 1; + required sint64 v = 1; } message Fixed32 { - required fixed32 v = 1; + required fixed32 v = 1; } message Fixed64 { - required fixed64 v = 1; + required fixed64 v = 1; } message Float { - required float v = 1; + required float v = 1; } message Double { - required double v = 1; + required double v = 1; } message Bool { - required bool v = 1; + required bool v = 1; } message String { - required string v = 1; + required string v = 1; } message Bytes { - required bytes v = 1; + required bytes v = 1; } message Message { diff --git a/internal/testprotos/test/ext.proto b/internal/testprotos/test/ext.proto index 9ff1dd61..51ade5a8 100644 --- a/internal/testprotos/test/ext.proto +++ b/internal/testprotos/test/ext.proto @@ -11,5 +11,5 @@ import "internal/testprotos/test/test.proto"; option go_package = "google.golang.org/protobuf/internal/testprotos/test"; extend TestAllExtensions { - optional int32 foreign_int32_extension = 2000; + optional int32 foreign_int32_extension = 2000; } diff --git a/internal/testprotos/test/test.pb.go b/internal/testprotos/test/test.pb.go index a828a515..af38ddb4 100644 --- a/internal/testprotos/test/test.pb.go +++ b/internal/testprotos/test/test.pb.go @@ -3594,21 +3594,21 @@ var file_internal_testprotos_test_test_proto_rawDesc = []byte{ 0x0a, 0x23, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x65, - 0x6e, 0x75, 0x6d, 0x73, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x2a, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, - 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x69, 0x6e, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x74, + 0x65, 0x73, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, + 0x77, 0x65, 0x61, 0x6b, 0x31, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x77, 0x65, 0x61, 0x6b, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, + 0x77, 0x65, 0x61, 0x6b, 0x32, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x77, 0x65, 0x61, 0x6b, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, + 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x74, 0x65, - 0x73, 0x74, 0x2f, 0x77, 0x65, 0x61, 0x6b, 0x31, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x77, 0x65, - 0x61, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x74, 0x65, - 0x73, 0x74, 0x2f, 0x77, 0x65, 0x61, 0x6b, 0x32, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x77, 0x65, - 0x61, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x3a, 0x0a, 0x0c, 0x54, 0x65, 0x73, + 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f, + 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x3a, 0x0a, 0x0c, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x33, 0x32, @@ -4792,7 +4792,7 @@ var file_internal_testprotos_test_test_proto_rawDesc = []byte{ 0x35, 0x5a, 0x33, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x50, 0x02, 0x58, 0x03, 0x58, 0x04, + 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x50, 0x00, 0x58, 0x01, 0x58, 0x02, } var ( @@ -5035,8 +5035,8 @@ func file_internal_testprotos_test_test_proto_init() { if File_internal_testprotos_test_test_proto != nil { return } - file_internal_testprotos_test_test_import_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 interface{}, i int) interface{} { switch v := v.(*TestAllTypes); i { diff --git a/internal/testprotos/test/test.proto b/internal/testprotos/test/test.proto index f841ad62..65a07e4f 100644 --- a/internal/testprotos/test/test.proto +++ b/internal/testprotos/test/test.proto @@ -6,12 +6,14 @@ syntax = "proto2"; package goproto.proto.test; -import "internal/testprotos/enums/enums.proto"; -import "internal/testprotos/test/test_import.proto"; import public "internal/testprotos/test/test_public.proto"; + import weak "internal/testprotos/test/weak1/test_weak.proto"; import weak "internal/testprotos/test/weak2/test_weak.proto"; +import "internal/testprotos/enums/enums.proto"; +import "internal/testprotos/test/test_import.proto"; + option go_package = "google.golang.org/protobuf/internal/testprotos/test"; message TestAllTypes { @@ -27,106 +29,106 @@ message TestAllTypes { NEG = -1; // Intentionally negative. } - optional int32 optional_int32 = 1; - optional int64 optional_int64 = 2; - optional uint32 optional_uint32 = 3; - optional uint64 optional_uint64 = 4; - optional sint32 optional_sint32 = 5; - optional sint64 optional_sint64 = 6; - optional fixed32 optional_fixed32 = 7; - optional fixed64 optional_fixed64 = 8; - optional sfixed32 optional_sfixed32 = 9; - optional sfixed64 optional_sfixed64 = 10; - optional float optional_float = 11; - optional double optional_double = 12; - optional bool optional_bool = 13; - optional string optional_string = 14; - optional bytes optional_bytes = 15; + optional int32 optional_int32 = 1; + optional int64 optional_int64 = 2; + optional uint32 optional_uint32 = 3; + optional uint64 optional_uint64 = 4; + optional sint32 optional_sint32 = 5; + optional sint64 optional_sint64 = 6; + optional fixed32 optional_fixed32 = 7; + optional fixed64 optional_fixed64 = 8; + optional sfixed32 optional_sfixed32 = 9; + optional sfixed64 optional_sfixed64 = 10; + optional float optional_float = 11; + optional double optional_double = 12; + optional bool optional_bool = 13; + optional string optional_string = 14; + optional bytes optional_bytes = 15; optional group OptionalGroup = 16 { optional int32 a = 17; optional NestedMessage optional_nested_message = 1000; optional int32 same_field_number = 16; } - optional NestedMessage optional_nested_message = 18; + optional NestedMessage optional_nested_message = 18; optional ForeignMessage optional_foreign_message = 19; - optional ImportMessage optional_import_message = 20; - optional NestedEnum optional_nested_enum = 21; - optional ForeignEnum optional_foreign_enum = 22; - optional ImportEnum optional_import_enum = 23; + optional ImportMessage optional_import_message = 20; + optional NestedEnum optional_nested_enum = 21; + optional ForeignEnum optional_foreign_enum = 22; + optional ImportEnum optional_import_enum = 23; - repeated int32 repeated_int32 = 31; - repeated int64 repeated_int64 = 32; - repeated uint32 repeated_uint32 = 33; - repeated uint64 repeated_uint64 = 34; - repeated sint32 repeated_sint32 = 35; - repeated sint64 repeated_sint64 = 36; - repeated fixed32 repeated_fixed32 = 37; - repeated fixed64 repeated_fixed64 = 38; - repeated sfixed32 repeated_sfixed32 = 39; - repeated sfixed64 repeated_sfixed64 = 40; - repeated float repeated_float = 41; - repeated double repeated_double = 42; - repeated bool repeated_bool = 43; - repeated string repeated_string = 44; - repeated bytes repeated_bytes = 45; + repeated int32 repeated_int32 = 31; + repeated int64 repeated_int64 = 32; + repeated uint32 repeated_uint32 = 33; + repeated uint64 repeated_uint64 = 34; + repeated sint32 repeated_sint32 = 35; + repeated sint64 repeated_sint64 = 36; + repeated fixed32 repeated_fixed32 = 37; + repeated fixed64 repeated_fixed64 = 38; + repeated sfixed32 repeated_sfixed32 = 39; + repeated sfixed64 repeated_sfixed64 = 40; + repeated float repeated_float = 41; + repeated double repeated_double = 42; + repeated bool repeated_bool = 43; + repeated string repeated_string = 44; + repeated bytes repeated_bytes = 45; repeated group RepeatedGroup = 46 { optional int32 a = 47; optional NestedMessage optional_nested_message = 1001; } - repeated NestedMessage repeated_nested_message = 48; + repeated NestedMessage repeated_nested_message = 48; repeated ForeignMessage repeated_foreign_message = 49; - repeated ImportMessage repeated_importmessage = 50; - repeated NestedEnum repeated_nested_enum = 51; - repeated ForeignEnum repeated_foreign_enum = 52; - repeated ImportEnum repeated_importenum = 53; + repeated ImportMessage repeated_importmessage = 50; + repeated NestedEnum repeated_nested_enum = 51; + repeated ForeignEnum repeated_foreign_enum = 52; + repeated ImportEnum repeated_importenum = 53; - map < int32, int32> map_int32_int32 = 56; - map < int64, int64> map_int64_int64 = 57; - map < uint32, uint32> map_uint32_uint32 = 58; - map < uint64, uint64> map_uint64_uint64 = 59; - map < sint32, sint32> map_sint32_sint32 = 60; - map < sint64, sint64> map_sint64_sint64 = 61; - map < fixed32, fixed32> map_fixed32_fixed32 = 62; - map < fixed64, fixed64> map_fixed64_fixed64 = 63; - map <sfixed32, sfixed32> map_sfixed32_sfixed32 = 64; - map <sfixed64, sfixed64> map_sfixed64_sfixed64 = 65; - map < int32, float> map_int32_float = 66; - map < int32, double> map_int32_double = 67; - map < bool, bool> map_bool_bool = 68; - map < string, string> map_string_string = 69; - map < string, bytes> map_string_bytes = 70; - map < string, NestedMessage> map_string_nested_message = 71; - map < string, NestedEnum> map_string_nested_enum = 73; + map<int32, int32> map_int32_int32 = 56; + map<int64, int64> map_int64_int64 = 57; + map<uint32, uint32> map_uint32_uint32 = 58; + map<uint64, uint64> map_uint64_uint64 = 59; + map<sint32, sint32> map_sint32_sint32 = 60; + map<sint64, sint64> map_sint64_sint64 = 61; + map<fixed32, fixed32> map_fixed32_fixed32 = 62; + map<fixed64, fixed64> map_fixed64_fixed64 = 63; + map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 64; + map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 65; + map<int32, float> map_int32_float = 66; + map<int32, double> map_int32_double = 67; + map<bool, bool> map_bool_bool = 68; + map<string, string> map_string_string = 69; + map<string, bytes> map_string_bytes = 70; + map<string, NestedMessage> map_string_nested_message = 71; + map<string, NestedEnum> map_string_nested_enum = 73; // Singular with defaults - optional int32 default_int32 = 81 [default = 81 ]; - optional int64 default_int64 = 82 [default = 82 ]; - optional uint32 default_uint32 = 83 [default = 83 ]; - optional uint64 default_uint64 = 84 [default = 84 ]; - optional sint32 default_sint32 = 85 [default = -85 ]; - optional sint64 default_sint64 = 86 [default = 86 ]; - optional fixed32 default_fixed32 = 87 [default = 87 ]; - optional fixed64 default_fixed64 = 88 [default = 88 ]; - optional sfixed32 default_sfixed32 = 89 [default = 89 ]; - optional sfixed64 default_sfixed64 = 80 [default = -90 ]; - optional float default_float = 91 [default = 91.5 ]; - optional double default_double = 92 [default = 92e3 ]; - optional bool default_bool = 93 [default = true ]; - optional string default_string = 94 [default = "hello"]; - optional bytes default_bytes = 95 [default = "world"]; - optional NestedEnum default_nested_enum = 96 [default = BAR ]; + optional int32 default_int32 = 81 [default = 81]; + optional int64 default_int64 = 82 [default = 82]; + optional uint32 default_uint32 = 83 [default = 83]; + optional uint64 default_uint64 = 84 [default = 84]; + optional sint32 default_sint32 = 85 [default = -85]; + optional sint64 default_sint64 = 86 [default = 86]; + optional fixed32 default_fixed32 = 87 [default = 87]; + optional fixed64 default_fixed64 = 88 [default = 88]; + optional sfixed32 default_sfixed32 = 89 [default = 89]; + optional sfixed64 default_sfixed64 = 80 [default = -90]; + optional float default_float = 91 [default = 91.5]; + optional double default_double = 92 [default = 92e3]; + optional bool default_bool = 93 [default = true]; + optional string default_string = 94 [default = "hello"]; + optional bytes default_bytes = 95 [default = "world"]; + optional NestedEnum default_nested_enum = 96 [default = BAR]; optional ForeignEnum default_foreign_enum = 97 [default = FOREIGN_BAR]; oneof oneof_field { - uint32 oneof_uint32 = 111; + uint32 oneof_uint32 = 111; NestedMessage oneof_nested_message = 112; - string oneof_string = 113; - bytes oneof_bytes = 114; - bool oneof_bool = 115; - uint64 oneof_uint64 = 116; - float oneof_float = 117; - double oneof_double = 118; - NestedEnum oneof_enum = 119; + string oneof_string = 113; + bytes oneof_bytes = 114; + bool oneof_bool = 115; + uint64 oneof_uint64 = 116; + float oneof_float = 117; + double oneof_double = 118; + NestedEnum oneof_enum = 119; group OneofGroup = 121 { optional int32 a = 1; optional int32 b = 2; @@ -141,10 +143,12 @@ message TestAllTypes { message TestDeprecatedMessage { option deprecated = true; - optional int32 deprecated_int32 = 1 [deprecated=true]; + + optional int32 deprecated_int32 = 1 [deprecated = true]; enum DeprecatedEnum { option deprecated = true; - DEPRECATED = 0 [deprecated=true]; + + DEPRECATED = 0 [deprecated = true]; } oneof deprecated_oneof { int32 deprecated_oneof_field = 2 [deprecated = true]; @@ -183,21 +187,21 @@ message TestAllExtensions { } extend TestAllExtensions { - optional int32 optional_int32 = 1; - optional int64 optional_int64 = 2; - optional uint32 optional_uint32 = 3; - optional uint64 optional_uint64 = 4; - optional sint32 optional_sint32 = 5; - optional sint64 optional_sint64 = 6; - optional fixed32 optional_fixed32 = 7; - optional fixed64 optional_fixed64 = 8; - optional sfixed32 optional_sfixed32 = 9; + optional int32 optional_int32 = 1; + optional int64 optional_int64 = 2; + optional uint32 optional_uint32 = 3; + optional uint64 optional_uint64 = 4; + optional sint32 optional_sint32 = 5; + optional sint64 optional_sint64 = 6; + optional fixed32 optional_fixed32 = 7; + optional fixed64 optional_fixed64 = 8; + optional sfixed32 optional_sfixed32 = 9; optional sfixed64 optional_sfixed64 = 10; - optional float optional_float = 11; - optional double optional_double = 12; - optional bool optional_bool = 13; - optional string optional_string = 14; - optional bytes optional_bytes = 15; + optional float optional_float = 11; + optional double optional_double = 12; + optional bool optional_bool = 13; + optional string optional_string = 14; + optional bytes optional_bytes = 15; optional group OptionalGroup = 16 { optional int32 a = 17; @@ -208,21 +212,21 @@ extend TestAllExtensions { optional TestAllExtensions.NestedMessage optional_nested_message = 18; optional TestAllTypes.NestedEnum optional_nested_enum = 21; - repeated int32 repeated_int32 = 31; - repeated int64 repeated_int64 = 32; - repeated uint32 repeated_uint32 = 33; - repeated uint64 repeated_uint64 = 34; - repeated sint32 repeated_sint32 = 35; - repeated sint64 repeated_sint64 = 36; - repeated fixed32 repeated_fixed32 = 37; - repeated fixed64 repeated_fixed64 = 38; + repeated int32 repeated_int32 = 31; + repeated int64 repeated_int64 = 32; + repeated uint32 repeated_uint32 = 33; + repeated uint64 repeated_uint64 = 34; + repeated sint32 repeated_sint32 = 35; + repeated sint64 repeated_sint64 = 36; + repeated fixed32 repeated_fixed32 = 37; + repeated fixed64 repeated_fixed64 = 38; repeated sfixed32 repeated_sfixed32 = 39; repeated sfixed64 repeated_sfixed64 = 40; - repeated float repeated_float = 41; - repeated double repeated_double = 42; - repeated bool repeated_bool = 43; - repeated string repeated_string = 44; - repeated bytes repeated_bytes = 45; + repeated float repeated_float = 41; + repeated double repeated_double = 42; + repeated bool repeated_bool = 43; + repeated string repeated_string = 44; + repeated bytes repeated_bytes = 45; repeated group RepeatedGroup = 46 { optional int32 a = 47; @@ -232,21 +236,21 @@ extend TestAllExtensions { repeated TestAllExtensions.NestedMessage repeated_nested_message = 48; repeated TestAllTypes.NestedEnum repeated_nested_enum = 51; - optional int32 default_int32 = 81 [default = 81 ]; - optional int64 default_int64 = 82 [default = 82 ]; - optional uint32 default_uint32 = 83 [default = 83 ]; - optional uint64 default_uint64 = 84 [default = 84 ]; - optional sint32 default_sint32 = 85 [default = -85 ]; - optional sint64 default_sint64 = 86 [default = 86 ]; - optional fixed32 default_fixed32 = 87 [default = 87 ]; - optional fixed64 default_fixed64 = 88 [default = 88 ]; - optional sfixed32 default_sfixed32 = 89 [default = 89 ]; - optional sfixed64 default_sfixed64 = 80 [default = -90 ]; - optional float default_float = 91 [default = 91.5 ]; - optional double default_double = 92 [default = 92e3 ]; - optional bool default_bool = 93 [default = true ]; - optional string default_string = 94 [default = "hello"]; - optional bytes default_bytes = 95 [default = "world"]; + optional int32 default_int32 = 81 [default = 81]; + optional int64 default_int64 = 82 [default = 82]; + optional uint32 default_uint32 = 83 [default = 83]; + optional uint64 default_uint64 = 84 [default = 84]; + optional sint32 default_sint32 = 85 [default = -85]; + optional sint64 default_sint64 = 86 [default = 86]; + optional fixed32 default_fixed32 = 87 [default = 87]; + optional fixed64 default_fixed64 = 88 [default = 88]; + optional sfixed32 default_sfixed32 = 89 [default = 89]; + optional sfixed64 default_sfixed64 = 80 [default = -90]; + optional float default_float = 91 [default = 91.5]; + optional double default_double = 92 [default = 92e3]; + optional bool default_bool = 93 [default = true]; + optional string default_string = 94 [default = "hello"]; + optional bytes default_bytes = 95 [default = "world"]; } message TestNestedExtension { @@ -260,13 +264,13 @@ message TestRequired { extend TestAllExtensions { optional TestRequired single = 1000; - repeated TestRequired multi = 1001; + repeated TestRequired multi = 1001; } } message TestRequiredForeign { - optional TestRequired optional_message = 1; - repeated TestRequired repeated_message = 2; + optional TestRequired optional_message = 1; + repeated TestRequired repeated_message = 2; map<int32, TestRequired> map_message = 3; oneof oneof_field { TestRequired oneof_message = 4; @@ -283,42 +287,44 @@ message TestRequiredGroupFields { } message TestWeak { - optional goproto.proto.test.weak.WeakImportMessage1 weak_message1 = 1 [weak=true]; - optional goproto.proto.test.weak.WeakImportMessage2 weak_message2 = 2 [weak=true]; + optional goproto.proto.test.weak.WeakImportMessage1 weak_message1 = 1 + [weak = true]; + optional goproto.proto.test.weak.WeakImportMessage2 weak_message2 = 2 + [weak = true]; } message TestPackedTypes { - repeated int32 packed_int32 = 90 [packed = true]; - repeated int64 packed_int64 = 91 [packed = true]; - repeated uint32 packed_uint32 = 92 [packed = true]; - repeated uint64 packed_uint64 = 93 [packed = true]; - repeated sint32 packed_sint32 = 94 [packed = true]; - repeated sint64 packed_sint64 = 95 [packed = true]; - repeated fixed32 packed_fixed32 = 96 [packed = true]; - repeated fixed64 packed_fixed64 = 97 [packed = true]; - repeated sfixed32 packed_sfixed32 = 98 [packed = true]; - repeated sfixed64 packed_sfixed64 = 99 [packed = true]; - repeated float packed_float = 100 [packed = true]; - repeated double packed_double = 101 [packed = true]; - repeated bool packed_bool = 102 [packed = true]; - repeated ForeignEnum packed_enum = 103 [packed = true]; + repeated int32 packed_int32 = 90 [packed = true]; + repeated int64 packed_int64 = 91 [packed = true]; + repeated uint32 packed_uint32 = 92 [packed = true]; + repeated uint64 packed_uint64 = 93 [packed = true]; + repeated sint32 packed_sint32 = 94 [packed = true]; + repeated sint64 packed_sint64 = 95 [packed = true]; + repeated fixed32 packed_fixed32 = 96 [packed = true]; + repeated fixed64 packed_fixed64 = 97 [packed = true]; + repeated sfixed32 packed_sfixed32 = 98 [packed = true]; + repeated sfixed64 packed_sfixed64 = 99 [packed = true]; + repeated float packed_float = 100 [packed = true]; + repeated double packed_double = 101 [packed = true]; + repeated bool packed_bool = 102 [packed = true]; + repeated ForeignEnum packed_enum = 103 [packed = true]; } message TestUnpackedTypes { - repeated int32 unpacked_int32 = 90 [packed = false]; - repeated int64 unpacked_int64 = 91 [packed = false]; - repeated uint32 unpacked_uint32 = 92 [packed = false]; - repeated uint64 unpacked_uint64 = 93 [packed = false]; - repeated sint32 unpacked_sint32 = 94 [packed = false]; - repeated sint64 unpacked_sint64 = 95 [packed = false]; - repeated fixed32 unpacked_fixed32 = 96 [packed = false]; - repeated fixed64 unpacked_fixed64 = 97 [packed = false]; - repeated sfixed32 unpacked_sfixed32 = 98 [packed = false]; - repeated sfixed64 unpacked_sfixed64 = 99 [packed = false]; - repeated float unpacked_float = 100 [packed = false]; - repeated double unpacked_double = 101 [packed = false]; - repeated bool unpacked_bool = 102 [packed = false]; - repeated ForeignEnum unpacked_enum = 103 [packed = false]; + repeated int32 unpacked_int32 = 90 [packed = false]; + repeated int64 unpacked_int64 = 91 [packed = false]; + repeated uint32 unpacked_uint32 = 92 [packed = false]; + repeated uint64 unpacked_uint64 = 93 [packed = false]; + repeated sint32 unpacked_sint32 = 94 [packed = false]; + repeated sint64 unpacked_sint64 = 95 [packed = false]; + repeated fixed32 unpacked_fixed32 = 96 [packed = false]; + repeated fixed64 unpacked_fixed64 = 97 [packed = false]; + repeated sfixed32 unpacked_sfixed32 = 98 [packed = false]; + repeated sfixed64 unpacked_sfixed64 = 99 [packed = false]; + repeated float unpacked_float = 100 [packed = false]; + repeated double unpacked_double = 101 [packed = false]; + repeated bool unpacked_bool = 102 [packed = false]; + repeated ForeignEnum unpacked_enum = 103 [packed = false]; } message TestPackedExtensions { @@ -326,20 +332,20 @@ message TestPackedExtensions { } extend TestPackedExtensions { - repeated int32 packed_int32 = 90 [packed = true]; - repeated int64 packed_int64 = 91 [packed = true]; - repeated uint32 packed_uint32 = 92 [packed = true]; - repeated uint64 packed_uint64 = 93 [packed = true]; - repeated sint32 packed_sint32 = 94 [packed = true]; - repeated sint64 packed_sint64 = 95 [packed = true]; - repeated fixed32 packed_fixed32 = 96 [packed = true]; - repeated fixed64 packed_fixed64 = 97 [packed = true]; - repeated sfixed32 packed_sfixed32 = 98 [packed = true]; - repeated sfixed64 packed_sfixed64 = 99 [packed = true]; - repeated float packed_float = 100 [packed = true]; - repeated double packed_double = 101 [packed = true]; - repeated bool packed_bool = 102 [packed = true]; - repeated ForeignEnum packed_enum = 103 [packed = true]; + repeated int32 packed_int32 = 90 [packed = true]; + repeated int64 packed_int64 = 91 [packed = true]; + repeated uint32 packed_uint32 = 92 [packed = true]; + repeated uint64 packed_uint64 = 93 [packed = true]; + repeated sint32 packed_sint32 = 94 [packed = true]; + repeated sint64 packed_sint64 = 95 [packed = true]; + repeated fixed32 packed_fixed32 = 96 [packed = true]; + repeated fixed64 packed_fixed64 = 97 [packed = true]; + repeated sfixed32 packed_sfixed32 = 98 [packed = true]; + repeated sfixed64 packed_sfixed64 = 99 [packed = true]; + repeated float packed_float = 100 [packed = true]; + repeated double packed_double = 101 [packed = true]; + repeated bool packed_bool = 102 [packed = true]; + repeated ForeignEnum packed_enum = 103 [packed = true]; } message TestUnpackedExtensions { @@ -347,24 +353,24 @@ message TestUnpackedExtensions { } extend TestUnpackedExtensions { - repeated int32 unpacked_int32 = 90 [packed = false]; - repeated int64 unpacked_int64 = 91 [packed = false]; - repeated uint32 unpacked_uint32 = 92 [packed = false]; - repeated uint64 unpacked_uint64 = 93 [packed = false]; - repeated sint32 unpacked_sint32 = 94 [packed = false]; - repeated sint64 unpacked_sint64 = 95 [packed = false]; - repeated fixed32 unpacked_fixed32 = 96 [packed = false]; - repeated fixed64 unpacked_fixed64 = 97 [packed = false]; - repeated sfixed32 unpacked_sfixed32 = 98 [packed = false]; - repeated sfixed64 unpacked_sfixed64 = 99 [packed = false]; - repeated float unpacked_float = 100 [packed = false]; - repeated double unpacked_double = 101 [packed = false]; - repeated bool unpacked_bool = 102 [packed = false]; - repeated ForeignEnum unpacked_enum = 103 [packed = false]; + repeated int32 unpacked_int32 = 90 [packed = false]; + repeated int64 unpacked_int64 = 91 [packed = false]; + repeated uint32 unpacked_uint32 = 92 [packed = false]; + repeated uint64 unpacked_uint64 = 93 [packed = false]; + repeated sint32 unpacked_sint32 = 94 [packed = false]; + repeated sint64 unpacked_sint64 = 95 [packed = false]; + repeated fixed32 unpacked_fixed32 = 96 [packed = false]; + repeated fixed64 unpacked_fixed64 = 97 [packed = false]; + repeated sfixed32 unpacked_sfixed32 = 98 [packed = false]; + repeated sfixed64 unpacked_sfixed64 = 99 [packed = false]; + repeated float unpacked_float = 100 [packed = false]; + repeated double unpacked_double = 101 [packed = false]; + repeated bool unpacked_bool = 102 [packed = false]; + repeated ForeignEnum unpacked_enum = 103 [packed = false]; } // Test that RPC services work. -message FooRequest {} +message FooRequest {} message FooResponse {} service TestService { @@ -374,13 +380,15 @@ service TestService { service TestDeprecatedService { option deprecated = true; + rpc Deprecated(TestDeprecatedMessage) returns (TestDeprecatedMessage) { option deprecated = true; } } message WeirdDefault { - optional bytes weird_default = 1 [default = "hello, \"world!\"\ndead\xde\xad\xbe\xefbeef`"]; + optional bytes weird_default = 1 + [default = "hello, \"world!\"\ndead\xde\xad\xbe\xefbeef`"]; } message RemoteDefault { diff --git a/internal/testprotos/test/test_import.proto b/internal/testprotos/test/test_import.proto index fa80cfab..cbd0e400 100644 --- a/internal/testprotos/test/test_import.proto +++ b/internal/testprotos/test/test_import.proto @@ -8,9 +8,8 @@ package goproto.proto.test; option go_package = "google.golang.org/protobuf/internal/testprotos/test"; -message ImportMessage { -} +message ImportMessage {} enum ImportEnum { - IMPORT_ZERO = 0; + IMPORT_ZERO = 0; } diff --git a/internal/testprotos/test/test_public.proto b/internal/testprotos/test/test_public.proto index d2f14a78..52b9855c 100644 --- a/internal/testprotos/test/test_public.proto +++ b/internal/testprotos/test/test_public.proto @@ -8,5 +8,4 @@ package goproto.proto.test; option go_package = "google.golang.org/protobuf/internal/testprotos/test"; -message PublicImportMessage { -} +message PublicImportMessage {} diff --git a/internal/testprotos/test/weak1/test_weak.proto b/internal/testprotos/test/weak1/test_weak.proto index 113ed1bc..c2da0c0d 100644 --- a/internal/testprotos/test/weak1/test_weak.proto +++ b/internal/testprotos/test/weak1/test_weak.proto @@ -9,5 +9,5 @@ package goproto.proto.test.weak; option go_package = "google.golang.org/protobuf/internal/testprotos/test/weak1"; message WeakImportMessage1 { - required int32 a = 1; + required int32 a = 1; } diff --git a/internal/testprotos/test/weak2/test_weak.proto b/internal/testprotos/test/weak2/test_weak.proto index 61a03d64..19fe0dd5 100644 --- a/internal/testprotos/test/weak2/test_weak.proto +++ b/internal/testprotos/test/weak2/test_weak.proto @@ -9,5 +9,5 @@ package goproto.proto.test.weak; option go_package = "google.golang.org/protobuf/internal/testprotos/test/weak2"; message WeakImportMessage2 { - required int32 a = 1; + required int32 a = 1; } diff --git a/internal/testprotos/test3/test.proto b/internal/testprotos/test3/test.proto index 4d9a63c7..59eb68e1 100644 --- a/internal/testprotos/test3/test.proto +++ b/internal/testprotos/test3/test.proto @@ -23,100 +23,100 @@ message TestAllTypes { NEG = -1; // Intentionally negative. } - int32 singular_int32 = 81; - int64 singular_int64 = 82; - uint32 singular_uint32 = 83; - uint64 singular_uint64 = 84; - sint32 singular_sint32 = 85; - sint64 singular_sint64 = 86; - fixed32 singular_fixed32 = 87; - fixed64 singular_fixed64 = 88; - sfixed32 singular_sfixed32 = 89; - sfixed64 singular_sfixed64 = 90; - float singular_float = 91; - double singular_double = 92; - bool singular_bool = 93; - string singular_string = 94; - bytes singular_bytes = 95; - NestedMessage singular_nested_message = 98; + int32 singular_int32 = 81; + int64 singular_int64 = 82; + uint32 singular_uint32 = 83; + uint64 singular_uint64 = 84; + sint32 singular_sint32 = 85; + sint64 singular_sint64 = 86; + fixed32 singular_fixed32 = 87; + fixed64 singular_fixed64 = 88; + sfixed32 singular_sfixed32 = 89; + sfixed64 singular_sfixed64 = 90; + float singular_float = 91; + double singular_double = 92; + bool singular_bool = 93; + string singular_string = 94; + bytes singular_bytes = 95; + NestedMessage singular_nested_message = 98; ForeignMessage singular_foreign_message = 99; - ImportMessage singular_import_message = 100; - NestedEnum singular_nested_enum = 101; - ForeignEnum singular_foreign_enum = 102; - ImportEnum singular_import_enum = 103; + ImportMessage singular_import_message = 100; + NestedEnum singular_nested_enum = 101; + ForeignEnum singular_foreign_enum = 102; + ImportEnum singular_import_enum = 103; - optional int32 optional_int32 = 1; - optional int64 optional_int64 = 2; - optional uint32 optional_uint32 = 3; - optional uint64 optional_uint64 = 4; - optional sint32 optional_sint32 = 5; - optional sint64 optional_sint64 = 6; - optional fixed32 optional_fixed32 = 7; - optional fixed64 optional_fixed64 = 8; - optional sfixed32 optional_sfixed32 = 9; - optional sfixed64 optional_sfixed64 = 10; - optional float optional_float = 11; - optional double optional_double = 12; - optional bool optional_bool = 13; - optional string optional_string = 14; - optional bytes optional_bytes = 15; - optional NestedMessage optional_nested_message = 18; + optional int32 optional_int32 = 1; + optional int64 optional_int64 = 2; + optional uint32 optional_uint32 = 3; + optional uint64 optional_uint64 = 4; + optional sint32 optional_sint32 = 5; + optional sint64 optional_sint64 = 6; + optional fixed32 optional_fixed32 = 7; + optional fixed64 optional_fixed64 = 8; + optional sfixed32 optional_sfixed32 = 9; + optional sfixed64 optional_sfixed64 = 10; + optional float optional_float = 11; + optional double optional_double = 12; + optional bool optional_bool = 13; + optional string optional_string = 14; + optional bytes optional_bytes = 15; + optional NestedMessage optional_nested_message = 18; optional ForeignMessage optional_foreign_message = 19; - optional ImportMessage optional_import_message = 20; - optional NestedEnum optional_nested_enum = 21; - optional ForeignEnum optional_foreign_enum = 22; - optional ImportEnum optional_import_enum = 23; + optional ImportMessage optional_import_message = 20; + optional NestedEnum optional_nested_enum = 21; + optional ForeignEnum optional_foreign_enum = 22; + optional ImportEnum optional_import_enum = 23; - repeated int32 repeated_int32 = 31; - repeated int64 repeated_int64 = 32; - repeated uint32 repeated_uint32 = 33; - repeated uint64 repeated_uint64 = 34; - repeated sint32 repeated_sint32 = 35; - repeated sint64 repeated_sint64 = 36; - repeated fixed32 repeated_fixed32 = 37; - repeated fixed64 repeated_fixed64 = 38; - repeated sfixed32 repeated_sfixed32 = 39; - repeated sfixed64 repeated_sfixed64 = 40; - repeated float repeated_float = 41; - repeated double repeated_double = 42; - repeated bool repeated_bool = 43; - repeated string repeated_string = 44; - repeated bytes repeated_bytes = 45; - repeated NestedMessage repeated_nested_message = 48; + repeated int32 repeated_int32 = 31; + repeated int64 repeated_int64 = 32; + repeated uint32 repeated_uint32 = 33; + repeated uint64 repeated_uint64 = 34; + repeated sint32 repeated_sint32 = 35; + repeated sint64 repeated_sint64 = 36; + repeated fixed32 repeated_fixed32 = 37; + repeated fixed64 repeated_fixed64 = 38; + repeated sfixed32 repeated_sfixed32 = 39; + repeated sfixed64 repeated_sfixed64 = 40; + repeated float repeated_float = 41; + repeated double repeated_double = 42; + repeated bool repeated_bool = 43; + repeated string repeated_string = 44; + repeated bytes repeated_bytes = 45; + repeated NestedMessage repeated_nested_message = 48; repeated ForeignMessage repeated_foreign_message = 49; - repeated ImportMessage repeated_importmessage = 50; - repeated NestedEnum repeated_nested_enum = 51; - repeated ForeignEnum repeated_foreign_enum = 52; - repeated ImportEnum repeated_importenum = 53; + repeated ImportMessage repeated_importmessage = 50; + repeated NestedEnum repeated_nested_enum = 51; + repeated ForeignEnum repeated_foreign_enum = 52; + repeated ImportEnum repeated_importenum = 53; - map < int32, int32> map_int32_int32 = 56; - map < int64, int64> map_int64_int64 = 57; - map < uint32, uint32> map_uint32_uint32 = 58; - map < uint64, uint64> map_uint64_uint64 = 59; - map < sint32, sint32> map_sint32_sint32 = 60; - map < sint64, sint64> map_sint64_sint64 = 61; - map < fixed32, fixed32> map_fixed32_fixed32 = 62; - map < fixed64, fixed64> map_fixed64_fixed64 = 63; - map <sfixed32, sfixed32> map_sfixed32_sfixed32 = 64; - map <sfixed64, sfixed64> map_sfixed64_sfixed64 = 65; - map < int32, float> map_int32_float = 66; - map < int32, double> map_int32_double = 67; - map < bool, bool> map_bool_bool = 68; - map < string, string> map_string_string = 69; - map < string, bytes> map_string_bytes = 70; - map < string, NestedMessage> map_string_nested_message = 71; - map < string, NestedEnum> map_string_nested_enum = 73; + map<int32, int32> map_int32_int32 = 56; + map<int64, int64> map_int64_int64 = 57; + map<uint32, uint32> map_uint32_uint32 = 58; + map<uint64, uint64> map_uint64_uint64 = 59; + map<sint32, sint32> map_sint32_sint32 = 60; + map<sint64, sint64> map_sint64_sint64 = 61; + map<fixed32, fixed32> map_fixed32_fixed32 = 62; + map<fixed64, fixed64> map_fixed64_fixed64 = 63; + map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 64; + map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 65; + map<int32, float> map_int32_float = 66; + map<int32, double> map_int32_double = 67; + map<bool, bool> map_bool_bool = 68; + map<string, string> map_string_string = 69; + map<string, bytes> map_string_bytes = 70; + map<string, NestedMessage> map_string_nested_message = 71; + map<string, NestedEnum> map_string_nested_enum = 73; oneof oneof_field { - uint32 oneof_uint32 = 111; + uint32 oneof_uint32 = 111; NestedMessage oneof_nested_message = 112; - string oneof_string = 113; - bytes oneof_bytes = 114; - bool oneof_bool = 115; - uint64 oneof_uint64 = 116; - float oneof_float = 117; - double oneof_double = 118; - NestedEnum oneof_enum = 119; + string oneof_string = 113; + bytes oneof_bytes = 114; + bool oneof_bool = 115; + uint64 oneof_uint64 = 116; + float oneof_float = 117; + double oneof_double = 118; + NestedEnum oneof_enum = 119; } } diff --git a/internal/testprotos/test3/test_extension.proto b/internal/testprotos/test3/test_extension.proto index 18a83819..b6d2c6f3 100644 --- a/internal/testprotos/test3/test_extension.proto +++ b/internal/testprotos/test3/test_extension.proto @@ -12,39 +12,39 @@ import "internal/testprotos/test3/test.proto"; option go_package = "google.golang.org/protobuf/internal/testprotos/test3"; extend google.protobuf.MessageOptions { - int32 optional_int32 = 1001; - int64 optional_int64 = 1002; - uint32 optional_uint32 = 1003; - uint64 optional_uint64 = 1004; - sint32 optional_sint32 = 1005; - sint64 optional_sint64 = 1006; - fixed32 optional_fixed32 = 1007; - fixed64 optional_fixed64 = 1008; - sfixed32 optional_sfixed32 = 1009; - sfixed64 optional_sfixed64 = 1010; - float optional_float = 1011; - double optional_double = 1012; - bool optional_bool = 1013; - string optional_string = 1014; - bytes optional_bytes = 1015; + int32 optional_int32 = 1001; + int64 optional_int64 = 1002; + uint32 optional_uint32 = 1003; + uint64 optional_uint64 = 1004; + sint32 optional_sint32 = 1005; + sint64 optional_sint64 = 1006; + fixed32 optional_fixed32 = 1007; + fixed64 optional_fixed64 = 1008; + sfixed32 optional_sfixed32 = 1009; + sfixed64 optional_sfixed64 = 1010; + float optional_float = 1011; + double optional_double = 1012; + bool optional_bool = 1013; + string optional_string = 1014; + bytes optional_bytes = 1015; ForeignMessage optional_foreign_message = 1016; - ForeignEnum optional_foreign_enum = 1017; + ForeignEnum optional_foreign_enum = 1017; - optional int32 optional_optional_int32 = 2001; - optional int64 optional_optional_int64 = 2002; - optional uint32 optional_optional_uint32 = 2003; - optional uint64 optional_optional_uint64 = 2004; - optional sint32 optional_optional_sint32 = 2005; - optional sint64 optional_optional_sint64 = 2006; - optional fixed32 optional_optional_fixed32 = 2007; - optional fixed64 optional_optional_fixed64 = 2008; - optional sfixed32 optional_optional_sfixed32 = 2009; - optional sfixed64 optional_optional_sfixed64 = 2010; - optional float optional_optional_float = 2011; - optional double optional_optional_double = 2012; - optional bool optional_optional_bool = 2013; - optional string optional_optional_string = 2014; - optional bytes optional_optional_bytes = 2015; + optional int32 optional_optional_int32 = 2001; + optional int64 optional_optional_int64 = 2002; + optional uint32 optional_optional_uint32 = 2003; + optional uint64 optional_optional_uint64 = 2004; + optional sint32 optional_optional_sint32 = 2005; + optional sint64 optional_optional_sint64 = 2006; + optional fixed32 optional_optional_fixed32 = 2007; + optional fixed64 optional_optional_fixed64 = 2008; + optional sfixed32 optional_optional_sfixed32 = 2009; + optional sfixed64 optional_optional_sfixed64 = 2010; + optional float optional_optional_float = 2011; + optional double optional_optional_double = 2012; + optional bool optional_optional_bool = 2013; + optional string optional_optional_string = 2014; + optional bytes optional_optional_bytes = 2015; optional ForeignMessage optional_optional_foreign_message = 2016; - optional ForeignEnum optional_optional_foreign_enum = 2017; + optional ForeignEnum optional_optional_foreign_enum = 2017; } diff --git a/internal/testprotos/test3/test_import.proto b/internal/testprotos/test3/test_import.proto index d639bd3d..8723e5f0 100644 --- a/internal/testprotos/test3/test_import.proto +++ b/internal/testprotos/test3/test_import.proto @@ -8,9 +8,8 @@ package goproto.proto.test3; option go_package = "google.golang.org/protobuf/internal/testprotos/test3"; -message ImportMessage { -} +message ImportMessage {} enum ImportEnum { - IMPORT_ZERO = 0; + IMPORT_ZERO = 0; } diff --git a/internal/testprotos/textpb2/test.pb.go b/internal/testprotos/textpb2/test.pb.go index ec254718..835ceafe 100644 --- a/internal/testprotos/textpb2/test.pb.go +++ b/internal/testprotos/textpb2/test.pb.go @@ -1798,13 +1798,13 @@ var file_internal_testprotos_textpb2_test_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x70, 0x62, 0x32, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x70, 0x62, 0x32, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, - 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, - 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, diff --git a/internal/testprotos/textpb2/test.proto b/internal/testprotos/textpb2/test.proto index a23558b2..571a741b 100644 --- a/internal/testprotos/textpb2/test.proto +++ b/internal/testprotos/textpb2/test.proto @@ -6,16 +6,17 @@ syntax = "proto2"; package pb2; -option go_package = "google.golang.org/protobuf/internal/testprotos/textpb2"; import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; -import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; +option go_package = "google.golang.org/protobuf/internal/testprotos/textpb2"; + // Scalars contains optional scalar fields. message Scalars { optional bool opt_bool = 1; @@ -53,9 +54,9 @@ message Enums { repeated Enum rpt_enum = 2; enum NestedEnum { - UNO = 1; - DOS = 2; - DIEZ = 10; + UNO = 1; + DOS = 2; + DIEZ = 10; } optional NestedEnum opt_nested_enum = 3; repeated NestedEnum rpt_nested_enum = 4; @@ -122,7 +123,8 @@ message PartialRequired { optional string opt_string = 2; } -// Following messages are for testing required field nested in optional, repeated and map fields. +// Following messages are for testing required field nested in optional, +// repeated and map fields. message NestedWithRequired { required string req_string = 1; diff --git a/internal/testprotos/textpb3/test.proto b/internal/testprotos/textpb3/test.proto index 8b1c7db5..577932a7 100644 --- a/internal/testprotos/textpb3/test.proto +++ b/internal/testprotos/textpb3/test.proto @@ -6,6 +6,7 @@ syntax = "proto3"; package pb3; + option go_package = "google.golang.org/protobuf/internal/testprotos/textpb3"; // Scalars contains scalar field types. @@ -72,10 +73,10 @@ message Enums { Enum s_enum = 1; enum NestedEnum { - CERO = 0; - UNO = 1; - DOS = 2; - DIEZ = 10; + CERO = 0; + UNO = 1; + DOS = 2; + DIEZ = 10; } NestedEnum s_nested_enum = 3; }