| 1 |
// Copyright 2024 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
edition = "2023"; |
| 6 |
|
| 7 |
package goproto.protoc.protoeditions; |
| 8 |
|
| 9 |
option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/protoeditions"; |
| 10 |
|
| 11 |
message FieldTestMessage { |
| 12 |
bool optional_bool = 1; |
| 13 |
Enum optional_enum = 2; |
| 14 |
int32 optional_int32 = 3; |
| 15 |
sint32 optional_sint32 = 4; |
| 16 |
uint32 optional_uint32 = 5; |
| 17 |
int64 optional_int64 = 6; |
| 18 |
sint64 optional_sint64 = 7; |
| 19 |
uint64 optional_uint64 = 8; |
| 20 |
sfixed32 optional_sfixed32 = 9; |
| 21 |
fixed32 optional_fixed32 = 10; |
| 22 |
float optional_float = 11; |
| 23 |
sfixed64 optional_sfixed64 = 12; |
| 24 |
fixed64 optional_fixed64 = 13; |
| 25 |
double optional_double = 14; |
| 26 |
string optional_string = 15; |
| 27 |
bytes optional_bytes = 16; |
| 28 |
Message optional_Message = 17; |
| 29 |
message OptionalGroup { |
| 30 |
string optionalgroup = 19; |
| 31 |
} |
| 32 |
OptionalGroup optionalgroup = 18 [features.message_encoding = DELIMITED]; |
| 33 |
|
| 34 |
bool required_bool = 101 [features.field_presence = LEGACY_REQUIRED]; |
| 35 |
Enum required_enum = 102 [features.field_presence = LEGACY_REQUIRED]; |
| 36 |
int32 required_int32 = 103 [features.field_presence = LEGACY_REQUIRED]; |
| 37 |
sint32 required_sint32 = 104 [features.field_presence = LEGACY_REQUIRED]; |
| 38 |
uint32 required_uint32 = 105 [features.field_presence = LEGACY_REQUIRED]; |
| 39 |
int64 required_int64 = 106 [features.field_presence = LEGACY_REQUIRED]; |
| 40 |
sint64 required_sint64 = 107 [features.field_presence = LEGACY_REQUIRED]; |
| 41 |
uint64 required_uint64 = 108 [features.field_presence = LEGACY_REQUIRED]; |
| 42 |
sfixed32 required_sfixed32 = 109 [features.field_presence = LEGACY_REQUIRED]; |
| 43 |
fixed32 required_fixed32 = 110 [features.field_presence = LEGACY_REQUIRED]; |
| 44 |
float required_float = 111 [features.field_presence = LEGACY_REQUIRED]; |
| 45 |
sfixed64 required_sfixed64 = 112 [features.field_presence = LEGACY_REQUIRED]; |
| 46 |
fixed64 required_fixed64 = 113 [features.field_presence = LEGACY_REQUIRED]; |
| 47 |
double required_double = 114 [features.field_presence = LEGACY_REQUIRED]; |
| 48 |
string required_string = 115 [features.field_presence = LEGACY_REQUIRED]; |
| 49 |
bytes required_bytes = 116 [features.field_presence = LEGACY_REQUIRED]; |
| 50 |
Message required_Message = 117 [features.field_presence = LEGACY_REQUIRED]; |
| 51 |
message RequiredGroup { |
| 52 |
string required_group = 119 [features.field_presence = LEGACY_REQUIRED]; |
| 53 |
} |
| 54 |
RequiredGroup requiredgroup = 118 [ |
| 55 |
features.message_encoding = DELIMITED, |
| 56 |
features.field_presence = LEGACY_REQUIRED |
| 57 |
]; |
| 58 |
|
| 59 |
repeated bool repeated_bool = 201; |
| 60 |
repeated Enum repeated_enum = 202; |
| 61 |
repeated int32 repeated_int32 = 203; |
| 62 |
repeated sint32 repeated_sint32 = 204; |
| 63 |
repeated uint32 repeated_uint32 = 205; |
| 64 |
repeated int64 repeated_int64 = 206; |
| 65 |
repeated sint64 repeated_sint64 = 207; |
| 66 |
repeated uint64 repeated_uint64 = 208; |
| 67 |
repeated sfixed32 repeated_sfixed32 = 209; |
| 68 |
repeated fixed32 repeated_fixed32 = 210; |
| 69 |
repeated float repeated_float = 211; |
| 70 |
repeated sfixed64 repeated_sfixed64 = 212; |
| 71 |
repeated fixed64 repeated_fixed64 = 213; |
| 72 |
repeated double repeated_double = 214; |
| 73 |
repeated string repeated_string = 215; |
| 74 |
repeated bytes repeated_bytes = 216; |
| 75 |
repeated Message repeated_Message = 217; |
| 76 |
message RepeatedGroup { |
| 77 |
repeated string repeated_group = 219; |
| 78 |
} |
| 79 |
repeated RepeatedGroup repeatedgroup = 218 |
| 80 |
[features.message_encoding = DELIMITED]; |
| 81 |
|
| 82 |
bool default_bool = 301 [default = true]; |
| 83 |
Enum default_enum = 302 [default = ONE]; |
| 84 |
int32 default_int32 = 303 [default = 1]; |
| 85 |
sint32 default_sint32 = 304 [default = 1]; |
| 86 |
uint32 default_uint32 = 305 [default = 1]; |
| 87 |
int64 default_int64 = 306 [default = 1]; |
| 88 |
sint64 default_sint64 = 307 [default = 1]; |
| 89 |
uint64 default_uint64 = 308 [default = 1]; |
| 90 |
sfixed32 default_sfixed32 = 309 [default = 1]; |
| 91 |
fixed32 default_fixed32 = 310 [default = 1]; |
| 92 |
float default_float = 311 [default = 3.14]; |
| 93 |
sfixed64 default_sfixed64 = 312 [default = 1]; |
| 94 |
fixed64 default_fixed64 = 313 [default = 1]; |
| 95 |
double default_double = 314 [default = 3.1415]; |
| 96 |
string default_string = 315 [default = "hello,\"world!\"\n"]; |
| 97 |
bytes default_bytes = 316 [default = "hello,\xde\xad\xbe\xef"]; |
| 98 |
|
| 99 |
string default_zero_string = 350 [default = ""]; |
| 100 |
bytes default_zero_bytes = 351 [default = ""]; |
| 101 |
|
| 102 |
float default_float_neginf = 400 [default = -inf]; |
| 103 |
float default_float_posinf = 401 [default = inf]; |
| 104 |
float default_float_nan = 402 [default = nan]; |
| 105 |
double default_double_neginf = 403 [default = -inf]; |
| 106 |
double default_double_posinf = 404 [default = inf]; |
| 107 |
double default_double_nan = 405 [default = nan]; |
| 108 |
|
| 109 |
map<int32, int64> map_int32_int64 = 500; |
| 110 |
map<string, Message> map_string_message = 501; |
| 111 |
map<fixed64, Enum> map_fixed64_enum = 502; |
| 112 |
|
| 113 |
message OneofGroup { |
| 114 |
string oneof_group_field = 619; |
| 115 |
} |
| 116 |
|
| 117 |
oneof oneof_field { |
| 118 |
bool oneof_bool = 601; |
| 119 |
Enum oneof_enum = 602; |
| 120 |
int32 oneof_int32 = 603; |
| 121 |
sint32 oneof_sint32 = 604; |
| 122 |
uint32 oneof_uint32 = 605; |
| 123 |
int64 oneof_int64 = 606; |
| 124 |
sint64 oneof_sint64 = 607; |
| 125 |
uint64 oneof_uint64 = 608; |
| 126 |
sfixed32 oneof_sfixed32 = 609; |
| 127 |
fixed32 oneof_fixed32 = 610; |
| 128 |
float oneof_float = 611; |
| 129 |
sfixed64 oneof_sfixed64 = 612; |
| 130 |
fixed64 oneof_fixed64 = 613; |
| 131 |
double oneof_double = 614; |
| 132 |
string oneof_string = 615; |
| 133 |
bytes oneof_bytes = 616; |
| 134 |
Message oneof_Message = 617; |
| 135 |
OneofGroup oneofgroup = 618 [features.message_encoding = DELIMITED]; |
| 136 |
int32 oneof_largest_tag = 536870911; |
| 137 |
} |
| 138 |
|
| 139 |
oneof oneof_two { |
| 140 |
int32 oneof_two_1 = 700; |
| 141 |
int64 oneof_two_2 = 701; |
| 142 |
} |
| 143 |
|
| 144 |
enum Enum { |
| 145 |
ZERO = 0; |
| 146 |
ONE = 1; |
| 147 |
} |
| 148 |
message Message {} |
| 149 |
|
| 150 |
reserved 10000, 10001; |
| 151 |
reserved TEN_THOUSAND, TEN_THOUSAND_AND_ONE; |
| 152 |
} |