| 1 |
// Code generated by protoc-gen-gogo. DO NOT EDIT. |
| 2 |
// source: typedecl.proto |
| 3 |
|
| 4 |
package typedecl |
| 5 |
|
| 6 |
import ( |
| 7 |
fmt "fmt" |
| 8 |
_ "github.com/gogo/protobuf/gogoproto" |
| 9 |
proto "github.com/gogo/protobuf/proto" |
| 10 |
io "io" |
| 11 |
math "math" |
| 12 |
math_bits "math/bits" |
| 13 |
) |
| 14 |
|
| 15 |
// Reference imports to suppress errors if they are not otherwise used. |
| 16 |
var _ = proto.Marshal |
| 17 |
var _ = fmt.Errorf |
| 18 |
var _ = math.Inf |
| 19 |
|
| 20 |
// This is a compile-time assertion to ensure that this generated file |
| 21 |
// is compatible with the proto package it is being compiled against. |
| 22 |
// A compilation error at this line likely means your copy of the |
| 23 |
// proto package needs to be updated. |
| 24 |
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package |
| 25 |
|
| 26 |
func (m *Dropped) Reset() { *m = Dropped{} } |
| 27 |
func (m *Dropped) String() string { return proto.CompactTextString(m) } |
| 28 |
func (*Dropped) ProtoMessage() {} |
| 29 |
func (*Dropped) Descriptor() ([]byte, []int) { |
| 30 |
return fileDescriptor_d070f1c0d5954996, []int{0} |
| 31 |
} |
| 32 |
func (m *Dropped) XXX_Unmarshal(b []byte) error { |
| 33 |
return m.Unmarshal(b) |
| 34 |
} |
| 35 |
func (m *Dropped) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| 36 |
if deterministic { |
| 37 |
return xxx_messageInfo_Dropped.Marshal(b, m, deterministic) |
| 38 |
} else { |
| 39 |
b = b[:cap(b)] |
| 40 |
n, err := m.MarshalToSizedBuffer(b) |
| 41 |
if err != nil { |
| 42 |
return nil, err |
| 43 |
} |
| 44 |
return b[:n], nil |
| 45 |
} |
| 46 |
} |
| 47 |
func (m *Dropped) XXX_Merge(src proto.Message) { |
| 48 |
xxx_messageInfo_Dropped.Merge(m, src) |
| 49 |
} |
| 50 |
func (m *Dropped) XXX_Size() int { |
| 51 |
return m.Size() |
| 52 |
} |
| 53 |
func (m *Dropped) XXX_DiscardUnknown() { |
| 54 |
xxx_messageInfo_Dropped.DiscardUnknown(m) |
| 55 |
} |
| 56 |
|
| 57 |
var xxx_messageInfo_Dropped proto.InternalMessageInfo |
| 58 |
|
| 59 |
func (m *Dropped) GetName() string { |
| 60 |
if m != nil { |
| 61 |
return m.Name |
| 62 |
} |
| 63 |
return "" |
| 64 |
} |
| 65 |
|
| 66 |
func (m *Dropped) GetAge() int32 { |
| 67 |
if m != nil { |
| 68 |
return m.Age |
| 69 |
} |
| 70 |
return 0 |
| 71 |
} |
| 72 |
|
| 73 |
func (m *DroppedWithoutGetters) Reset() { *m = DroppedWithoutGetters{} } |
| 74 |
func (m *DroppedWithoutGetters) String() string { return proto.CompactTextString(m) } |
| 75 |
func (*DroppedWithoutGetters) ProtoMessage() {} |
| 76 |
func (*DroppedWithoutGetters) Descriptor() ([]byte, []int) { |
| 77 |
return fileDescriptor_d070f1c0d5954996, []int{1} |
| 78 |
} |
| 79 |
func (m *DroppedWithoutGetters) XXX_Unmarshal(b []byte) error { |
| 80 |
return m.Unmarshal(b) |
| 81 |
} |
| 82 |
func (m *DroppedWithoutGetters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| 83 |
if deterministic { |
| 84 |
return xxx_messageInfo_DroppedWithoutGetters.Marshal(b, m, deterministic) |
| 85 |
} else { |
| 86 |
b = b[:cap(b)] |
| 87 |
n, err := m.MarshalToSizedBuffer(b) |
| 88 |
if err != nil { |
| 89 |
return nil, err |
| 90 |
} |
| 91 |
return b[:n], nil |
| 92 |
} |
| 93 |
} |
| 94 |
func (m *DroppedWithoutGetters) XXX_Merge(src proto.Message) { |
| 95 |
xxx_messageInfo_DroppedWithoutGetters.Merge(m, src) |
| 96 |
} |
| 97 |
func (m *DroppedWithoutGetters) XXX_Size() int { |
| 98 |
return m.Size() |
| 99 |
} |
| 100 |
func (m *DroppedWithoutGetters) XXX_DiscardUnknown() { |
| 101 |
xxx_messageInfo_DroppedWithoutGetters.DiscardUnknown(m) |
| 102 |
} |
| 103 |
|
| 104 |
var xxx_messageInfo_DroppedWithoutGetters proto.InternalMessageInfo |
| 105 |
|
| 106 |
type Kept struct { |
| 107 |
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` |
| 108 |
Age int32 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"` |
| 109 |
XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| 110 |
XXX_sizecache int32 `json:"-"` |
| 111 |
} |
| 112 |
|
| 113 |
func (m *Kept) Reset() { *m = Kept{} } |
| 114 |
func (m *Kept) String() string { return proto.CompactTextString(m) } |
| 115 |
func (*Kept) ProtoMessage() {} |
| 116 |
func (*Kept) Descriptor() ([]byte, []int) { |
| 117 |
return fileDescriptor_d070f1c0d5954996, []int{2} |
| 118 |
} |
| 119 |
func (m *Kept) XXX_Unmarshal(b []byte) error { |
| 120 |
return m.Unmarshal(b) |
| 121 |
} |
| 122 |
func (m *Kept) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| 123 |
if deterministic { |
| 124 |
return xxx_messageInfo_Kept.Marshal(b, m, deterministic) |
| 125 |
} else { |
| 126 |
b = b[:cap(b)] |
| 127 |
n, err := m.MarshalToSizedBuffer(b) |
| 128 |
if err != nil { |
| 129 |
return nil, err |
| 130 |
} |
| 131 |
return b[:n], nil |
| 132 |
} |
| 133 |
} |
| 134 |
func (m *Kept) XXX_Merge(src proto.Message) { |
| 135 |
xxx_messageInfo_Kept.Merge(m, src) |
| 136 |
} |
| 137 |
func (m *Kept) XXX_Size() int { |
| 138 |
return m.Size() |
| 139 |
} |
| 140 |
func (m *Kept) XXX_DiscardUnknown() { |
| 141 |
xxx_messageInfo_Kept.DiscardUnknown(m) |
| 142 |
} |
| 143 |
|
| 144 |
var xxx_messageInfo_Kept proto.InternalMessageInfo |
| 145 |
|
| 146 |
func (m *Kept) GetName() string { |
| 147 |
if m != nil { |
| 148 |
return m.Name |
| 149 |
} |
| 150 |
return "" |
| 151 |
} |
| 152 |
|
| 153 |
func (m *Kept) GetAge() int32 { |
| 154 |
if m != nil { |
| 155 |
return m.Age |
| 156 |
} |
| 157 |
return 0 |
| 158 |
} |
| 159 |
|
| 160 |
func init() { |
| 161 |
proto.RegisterType((*Dropped)(nil), "typedecl.Dropped") |
| 162 |
proto.RegisterType((*DroppedWithoutGetters)(nil), "typedecl.DroppedWithoutGetters") |
| 163 |
proto.RegisterType((*Kept)(nil), "typedecl.Kept") |
| 164 |
} |
| 165 |
|
| 166 |
func init() { proto.RegisterFile("typedecl.proto", fileDescriptor_d070f1c0d5954996) } |
| 167 |
|
| 168 |
var fileDescriptor_d070f1c0d5954996 = []byte{ |
| 169 |
// 246 bytes of a gzipped FileDescriptorProto |
| 170 |
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2b, 0xa9, 0x2c, 0x48, |
| 171 |
0x4d, 0x49, 0x4d, 0xce, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x80, 0xf1, 0xa5, 0x74, |
| 172 |
0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xd3, 0xf3, 0xd3, 0xf3, 0xf5, |
| 173 |
0xc1, 0x0a, 0x92, 0x4a, 0xd3, 0xc0, 0x3c, 0x30, 0x07, 0xcc, 0x82, 0x68, 0x54, 0x32, 0xe5, 0x62, |
| 174 |
0x77, 0x29, 0xca, 0x2f, 0x28, 0x48, 0x4d, 0x11, 0x12, 0xe2, 0x62, 0xc9, 0x4b, 0xcc, 0x4d, 0x95, |
| 175 |
0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x85, 0x04, 0xb8, 0x98, 0x13, 0xd3, 0x53, 0x25, |
| 176 |
0x98, 0x14, 0x18, 0x35, 0x58, 0x83, 0x40, 0x4c, 0x2b, 0x96, 0x0f, 0x0b, 0xe5, 0x19, 0x94, 0xfc, |
| 177 |
0xb9, 0x44, 0xa1, 0xda, 0xc2, 0x33, 0x4b, 0x32, 0xf2, 0x4b, 0x4b, 0xdc, 0x53, 0x4b, 0x4a, 0x52, |
| 178 |
0x8b, 0x8a, 0x85, 0xc4, 0xb8, 0xd8, 0x32, 0x52, 0x33, 0xd3, 0x33, 0x4a, 0xc0, 0xc6, 0x30, 0x07, |
| 179 |
0x41, 0x79, 0x42, 0x22, 0x5c, 0xac, 0xe5, 0x99, 0x29, 0x25, 0x19, 0x60, 0xa3, 0x98, 0x83, 0x20, |
| 180 |
0x1c, 0x2b, 0x8e, 0x8e, 0x05, 0xf2, 0x0c, 0x60, 0x03, 0x75, 0xb8, 0x58, 0xbc, 0x53, 0x0b, 0x4a, |
| 181 |
0x88, 0x73, 0x84, 0x93, 0xce, 0x83, 0x87, 0x72, 0x8c, 0x3f, 0x1e, 0xca, 0x31, 0xae, 0x78, 0x24, |
| 182 |
0xc7, 0xb8, 0xe3, 0x91, 0x1c, 0xe3, 0x81, 0x47, 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, |
| 183 |
0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x8f, 0x47, 0x72, 0x0c, 0x0d, 0x8f, 0xe5, 0x18, 0x26, |
| 184 |
0x3c, 0x96, 0x63, 0x48, 0x62, 0x03, 0x7b, 0xd5, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x0c, 0x57, |
| 185 |
0x14, 0x5c, 0x35, 0x01, 0x00, 0x00, |
| 186 |
} |
| 187 |
|
| 188 |
func (this *Dropped) VerboseEqual(that interface{}) error { |
| 189 |
if that == nil { |
| 190 |
if this == nil { |
| 191 |
return nil |
| 192 |
} |
| 193 |
return fmt.Errorf("that == nil && this != nil") |
| 194 |
} |
| 195 |
|
| 196 |
that1, ok := that.(*Dropped) |
| 197 |
if !ok { |
| 198 |
that2, ok := that.(Dropped) |
| 199 |
if ok { |
| 200 |
that1 = &that2 |
| 201 |
} else { |
| 202 |
return fmt.Errorf("that is not of type *Dropped") |
| 203 |
} |
| 204 |
} |
| 205 |
if that1 == nil { |
| 206 |
if this == nil { |
| 207 |
return nil |
| 208 |
} |
| 209 |
return fmt.Errorf("that is type *Dropped but is nil && this != nil") |
| 210 |
} else if this == nil { |
| 211 |
return fmt.Errorf("that is type *Dropped but is not nil && this == nil") |
| 212 |
} |
| 213 |
if this.Name != that1.Name { |
| 214 |
return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) |
| 215 |
} |
| 216 |
if this.Age != that1.Age { |
| 217 |
return fmt.Errorf("Age this(%v) Not Equal that(%v)", this.Age, that1.Age) |
| 218 |
} |
| 219 |
return nil |
| 220 |
} |
| 221 |
func (this *Dropped) Equal(that interface{}) bool { |
| 222 |
if that == nil { |
| 223 |
return this == nil |
| 224 |
} |
| 225 |
|
| 226 |
that1, ok := that.(*Dropped) |
| 227 |
if !ok { |
| 228 |
that2, ok := that.(Dropped) |
| 229 |
if ok { |
| 230 |
that1 = &that2 |
| 231 |
} else { |
| 232 |
return false |
| 233 |
} |
| 234 |
} |
| 235 |
if that1 == nil { |
| 236 |
return this == nil |
| 237 |
} else if this == nil { |
| 238 |
return false |
| 239 |
} |
| 240 |
if this.Name != that1.Name { |
| 241 |
return false |
| 242 |
} |
| 243 |
if this.Age != that1.Age { |
| 244 |
return false |
| 245 |
} |
| 246 |
return true |
| 247 |
} |
| 248 |
func (this *DroppedWithoutGetters) VerboseEqual(that interface{}) error { |
| 249 |
if that == nil { |
| 250 |
if this == nil { |
| 251 |
return nil |
| 252 |
} |
| 253 |
return fmt.Errorf("that == nil && this != nil") |
| 254 |
} |
| 255 |
|
| 256 |
that1, ok := that.(*DroppedWithoutGetters) |
| 257 |
if !ok { |
| 258 |
that2, ok := that.(DroppedWithoutGetters) |
| 259 |
if ok { |
| 260 |
that1 = &that2 |
| 261 |
} else { |
| 262 |
return fmt.Errorf("that is not of type *DroppedWithoutGetters") |
| 263 |
} |
| 264 |
} |
| 265 |
if that1 == nil { |
| 266 |
if this == nil { |
| 267 |
return nil |
| 268 |
} |
| 269 |
return fmt.Errorf("that is type *DroppedWithoutGetters but is nil && this != nil") |
| 270 |
} else if this == nil { |
| 271 |
return fmt.Errorf("that is type *DroppedWithoutGetters but is not nil && this == nil") |
| 272 |
} |
| 273 |
if this.Height != that1.Height { |
| 274 |
return fmt.Errorf("Height this(%v) Not Equal that(%v)", this.Height, that1.Height) |
| 275 |
} |
| 276 |
if this.Width != that1.Width { |
| 277 |
return fmt.Errorf("Width this(%v) Not Equal that(%v)", this.Width, that1.Width) |
| 278 |
} |
| 279 |
return nil |
| 280 |
} |
| 281 |
func (this *DroppedWithoutGetters) Equal(that interface{}) bool { |
| 282 |
if that == nil { |
| 283 |
return this == nil |
| 284 |
} |
| 285 |
|
| 286 |
that1, ok := that.(*DroppedWithoutGetters) |
| 287 |
if !ok { |
| 288 |
that2, ok := that.(DroppedWithoutGetters) |
| 289 |
if ok { |
| 290 |
that1 = &that2 |
| 291 |
} else { |
| 292 |
return false |
| 293 |
} |
| 294 |
} |
| 295 |
if that1 == nil { |
| 296 |
return this == nil |
| 297 |
} else if this == nil { |
| 298 |
return false |
| 299 |
} |
| 300 |
if this.Height != that1.Height { |
| 301 |
return false |
| 302 |
} |
| 303 |
if this.Width != that1.Width { |
| 304 |
return false |
| 305 |
} |
| 306 |
return true |
| 307 |
} |
| 308 |
func (this *Kept) VerboseEqual(that interface{}) error { |
| 309 |
if that == nil { |
| 310 |
if this == nil { |
| 311 |
return nil |
| 312 |
} |
| 313 |
return fmt.Errorf("that == nil && this != nil") |
| 314 |
} |
| 315 |
|
| 316 |
that1, ok := that.(*Kept) |
| 317 |
if !ok { |
| 318 |
that2, ok := that.(Kept) |
| 319 |
if ok { |
| 320 |
that1 = &that2 |
| 321 |
} else { |
| 322 |
return fmt.Errorf("that is not of type *Kept") |
| 323 |
} |
| 324 |
} |
| 325 |
if that1 == nil { |
| 326 |
if this == nil { |
| 327 |
return nil |
| 328 |
} |
| 329 |
return fmt.Errorf("that is type *Kept but is nil && this != nil") |
| 330 |
} else if this == nil { |
| 331 |
return fmt.Errorf("that is type *Kept but is not nil && this == nil") |
| 332 |
} |
| 333 |
if this.Name != that1.Name { |
| 334 |
return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) |
| 335 |
} |
| 336 |
if this.Age != that1.Age { |
| 337 |
return fmt.Errorf("Age this(%v) Not Equal that(%v)", this.Age, that1.Age) |
| 338 |
} |
| 339 |
return nil |
| 340 |
} |
| 341 |
func (this *Kept) Equal(that interface{}) bool { |
| 342 |
if that == nil { |
| 343 |
return this == nil |
| 344 |
} |
| 345 |
|
| 346 |
that1, ok := that.(*Kept) |
| 347 |
if !ok { |
| 348 |
that2, ok := that.(Kept) |
| 349 |
if ok { |
| 350 |
that1 = &that2 |
| 351 |
} else { |
| 352 |
return false |
| 353 |
} |
| 354 |
} |
| 355 |
if that1 == nil { |
| 356 |
return this == nil |
| 357 |
} else if this == nil { |
| 358 |
return false |
| 359 |
} |
| 360 |
if this.Name != that1.Name { |
| 361 |
return false |
| 362 |
} |
| 363 |
if this.Age != that1.Age { |
| 364 |
return false |
| 365 |
} |
| 366 |
return true |
| 367 |
} |
| 368 |
func (m *Dropped) Marshal() (dAtA []byte, err error) { |
| 369 |
size := m.Size() |
| 370 |
dAtA = make([]byte, size) |
| 371 |
n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| 372 |
if err != nil { |
| 373 |
return nil, err |
| 374 |
} |
| 375 |
return dAtA[:n], nil |
| 376 |
} |
| 377 |
|
| 378 |
func (m *Dropped) MarshalTo(dAtA []byte) (int, error) { |
| 379 |
size := m.Size() |
| 380 |
return m.MarshalToSizedBuffer(dAtA[:size]) |
| 381 |
} |
| 382 |
|
| 383 |
func (m *Dropped) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| 384 |
i := len(dAtA) |
| 385 |
_ = i |
| 386 |
var l int |
| 387 |
_ = l |
| 388 |
if m.Age != 0 { |
| 389 |
i = encodeVarintTypedecl(dAtA, i, uint64(m.Age)) |
| 390 |
i-- |
| 391 |
dAtA[i] = 0x10 |
| 392 |
} |
| 393 |
if len(m.Name) > 0 { |
| 394 |
i -= len(m.Name) |
| 395 |
copy(dAtA[i:], m.Name) |
| 396 |
i = encodeVarintTypedecl(dAtA, i, uint64(len(m.Name))) |
| 397 |
i-- |
| 398 |
dAtA[i] = 0xa |
| 399 |
} |
| 400 |
return len(dAtA) - i, nil |
| 401 |
} |
| 402 |
|
| 403 |
func (m *DroppedWithoutGetters) Marshal() (dAtA []byte, err error) { |
| 404 |
size := m.Size() |
| 405 |
dAtA = make([]byte, size) |
| 406 |
n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| 407 |
if err != nil { |
| 408 |
return nil, err |
| 409 |
} |
| 410 |
return dAtA[:n], nil |
| 411 |
} |
| 412 |
|
| 413 |
func (m *DroppedWithoutGetters) MarshalTo(dAtA []byte) (int, error) { |
| 414 |
size := m.Size() |
| 415 |
return m.MarshalToSizedBuffer(dAtA[:size]) |
| 416 |
} |
| 417 |
|
| 418 |
func (m *DroppedWithoutGetters) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| 419 |
i := len(dAtA) |
| 420 |
_ = i |
| 421 |
var l int |
| 422 |
_ = l |
| 423 |
if m.Width != 0 { |
| 424 |
i = encodeVarintTypedecl(dAtA, i, uint64(m.Width)) |
| 425 |
i-- |
| 426 |
dAtA[i] = 0x10 |
| 427 |
} |
| 428 |
if m.Height != 0 { |
| 429 |
i = encodeVarintTypedecl(dAtA, i, uint64(m.Height)) |
| 430 |
i-- |
| 431 |
dAtA[i] = 0x8 |
| 432 |
} |
| 433 |
return len(dAtA) - i, nil |
| 434 |
} |
| 435 |
|
| 436 |
func (m *Kept) Marshal() (dAtA []byte, err error) { |
| 437 |
size := m.Size() |
| 438 |
dAtA = make([]byte, size) |
| 439 |
n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| 440 |
if err != nil { |
| 441 |
return nil, err |
| 442 |
} |
| 443 |
return dAtA[:n], nil |
| 444 |
} |
| 445 |
|
| 446 |
func (m *Kept) MarshalTo(dAtA []byte) (int, error) { |
| 447 |
size := m.Size() |
| 448 |
return m.MarshalToSizedBuffer(dAtA[:size]) |
| 449 |
} |
| 450 |
|
| 451 |
func (m *Kept) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| 452 |
i := len(dAtA) |
| 453 |
_ = i |
| 454 |
var l int |
| 455 |
_ = l |
| 456 |
if m.Age != 0 { |
| 457 |
i = encodeVarintTypedecl(dAtA, i, uint64(m.Age)) |
| 458 |
i-- |
| 459 |
dAtA[i] = 0x10 |
| 460 |
} |
| 461 |
if len(m.Name) > 0 { |
| 462 |
i -= len(m.Name) |
| 463 |
copy(dAtA[i:], m.Name) |
| 464 |
i = encodeVarintTypedecl(dAtA, i, uint64(len(m.Name))) |
| 465 |
i-- |
| 466 |
dAtA[i] = 0xa |
| 467 |
} |
| 468 |
return len(dAtA) - i, nil |
| 469 |
} |
| 470 |
|
| 471 |
func encodeVarintTypedecl(dAtA []byte, offset int, v uint64) int { |
| 472 |
offset -= sovTypedecl(v) |
| 473 |
base := offset |
| 474 |
for v >= 1<<7 { |
| 475 |
dAtA[offset] = uint8(v&0x7f | 0x80) |
| 476 |
v >>= 7 |
| 477 |
offset++ |
| 478 |
} |
| 479 |
dAtA[offset] = uint8(v) |
| 480 |
return base |
| 481 |
} |
| 482 |
func NewPopulatedDropped(r randyTypedecl, easy bool) *Dropped { |
| 483 |
this := &Dropped{} |
| 484 |
this.Name = string(randStringTypedecl(r)) |
| 485 |
this.Age = int32(r.Int31()) |
| 486 |
if r.Intn(2) == 0 { |
| 487 |
this.Age *= -1 |
| 488 |
} |
| 489 |
if !easy && r.Intn(10) != 0 { |
| 490 |
} |
| 491 |
return this |
| 492 |
} |
| 493 |
|
| 494 |
func NewPopulatedDroppedWithoutGetters(r randyTypedecl, easy bool) *DroppedWithoutGetters { |
| 495 |
this := &DroppedWithoutGetters{} |
| 496 |
this.Height = int64(r.Int63()) |
| 497 |
if r.Intn(2) == 0 { |
| 498 |
this.Height *= -1 |
| 499 |
} |
| 500 |
this.Width = int64(r.Int63()) |
| 501 |
if r.Intn(2) == 0 { |
| 502 |
this.Width *= -1 |
| 503 |
} |
| 504 |
if !easy && r.Intn(10) != 0 { |
| 505 |
} |
| 506 |
return this |
| 507 |
} |
| 508 |
|
| 509 |
func NewPopulatedKept(r randyTypedecl, easy bool) *Kept { |
| 510 |
this := &Kept{} |
| 511 |
this.Name = string(randStringTypedecl(r)) |
| 512 |
this.Age = int32(r.Int31()) |
| 513 |
if r.Intn(2) == 0 { |
| 514 |
this.Age *= -1 |
| 515 |
} |
| 516 |
if !easy && r.Intn(10) != 0 { |
| 517 |
} |
| 518 |
return this |
| 519 |
} |
| 520 |
|
| 521 |
type randyTypedecl interface { |
| 522 |
Float32() float32 |
| 523 |
Float64() float64 |
| 524 |
Int63() int64 |
| 525 |
Int31() int32 |
| 526 |
Uint32() uint32 |
| 527 |
Intn(n int) int |
| 528 |
} |
| 529 |
|
| 530 |
func randUTF8RuneTypedecl(r randyTypedecl) rune { |
| 531 |
ru := r.Intn(62) |
| 532 |
if ru < 10 { |
| 533 |
return rune(ru + 48) |
| 534 |
} else if ru < 36 { |
| 535 |
return rune(ru + 55) |
| 536 |
} |
| 537 |
return rune(ru + 61) |
| 538 |
} |
| 539 |
func randStringTypedecl(r randyTypedecl) string { |
| 540 |
v1 := r.Intn(100) |
| 541 |
tmps := make([]rune, v1) |
| 542 |
for i := 0; i < v1; i++ { |
| 543 |
tmps[i] = randUTF8RuneTypedecl(r) |
| 544 |
} |
| 545 |
return string(tmps) |
| 546 |
} |
| 547 |
func randUnrecognizedTypedecl(r randyTypedecl, maxFieldNumber int) (dAtA []byte) { |
| 548 |
l := r.Intn(5) |
| 549 |
for i := 0; i < l; i++ { |
| 550 |
wire := r.Intn(4) |
| 551 |
if wire == 3 { |
| 552 |
wire = 5 |
| 553 |
} |
| 554 |
fieldNumber := maxFieldNumber + r.Intn(100) |
| 555 |
dAtA = randFieldTypedecl(dAtA, r, fieldNumber, wire) |
| 556 |
} |
| 557 |
return dAtA |
| 558 |
} |
| 559 |
func randFieldTypedecl(dAtA []byte, r randyTypedecl, fieldNumber int, wire int) []byte { |
| 560 |
key := uint32(fieldNumber)<<3 | uint32(wire) |
| 561 |
switch wire { |
| 562 |
case 0: |
| 563 |
dAtA = encodeVarintPopulateTypedecl(dAtA, uint64(key)) |
| 564 |
v2 := r.Int63() |
| 565 |
if r.Intn(2) == 0 { |
| 566 |
v2 *= -1 |
| 567 |
} |
| 568 |
dAtA = encodeVarintPopulateTypedecl(dAtA, uint64(v2)) |
| 569 |
case 1: |
| 570 |
dAtA = encodeVarintPopulateTypedecl(dAtA, uint64(key)) |
| 571 |
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) |
| 572 |
case 2: |
| 573 |
dAtA = encodeVarintPopulateTypedecl(dAtA, uint64(key)) |
| 574 |
ll := r.Intn(100) |
| 575 |
dAtA = encodeVarintPopulateTypedecl(dAtA, uint64(ll)) |
| 576 |
for j := 0; j < ll; j++ { |
| 577 |
dAtA = append(dAtA, byte(r.Intn(256))) |
| 578 |
} |
| 579 |
default: |
| 580 |
dAtA = encodeVarintPopulateTypedecl(dAtA, uint64(key)) |
| 581 |
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) |
| 582 |
} |
| 583 |
return dAtA |
| 584 |
} |
| 585 |
func encodeVarintPopulateTypedecl(dAtA []byte, v uint64) []byte { |
| 586 |
for v >= 1<<7 { |
| 587 |
dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) |
| 588 |
v >>= 7 |
| 589 |
} |
| 590 |
dAtA = append(dAtA, uint8(v)) |
| 591 |
return dAtA |
| 592 |
} |
| 593 |
func (m *Dropped) Size() (n int) { |
| 594 |
if m == nil { |
| 595 |
return 0 |
| 596 |
} |
| 597 |
var l int |
| 598 |
_ = l |
| 599 |
l = len(m.Name) |
| 600 |
if l > 0 { |
| 601 |
n += 1 + l + sovTypedecl(uint64(l)) |
| 602 |
} |
| 603 |
if m.Age != 0 { |
| 604 |
n += 1 + sovTypedecl(uint64(m.Age)) |
| 605 |
} |
| 606 |
return n |
| 607 |
} |
| 608 |
|
| 609 |
func (m *DroppedWithoutGetters) Size() (n int) { |
| 610 |
if m == nil { |
| 611 |
return 0 |
| 612 |
} |
| 613 |
var l int |
| 614 |
_ = l |
| 615 |
if m.Height != 0 { |
| 616 |
n += 1 + sovTypedecl(uint64(m.Height)) |
| 617 |
} |
| 618 |
if m.Width != 0 { |
| 619 |
n += 1 + sovTypedecl(uint64(m.Width)) |
| 620 |
} |
| 621 |
return n |
| 622 |
} |
| 623 |
|
| 624 |
func (m *Kept) Size() (n int) { |
| 625 |
if m == nil { |
| 626 |
return 0 |
| 627 |
} |
| 628 |
var l int |
| 629 |
_ = l |
| 630 |
l = len(m.Name) |
| 631 |
if l > 0 { |
| 632 |
n += 1 + l + sovTypedecl(uint64(l)) |
| 633 |
} |
| 634 |
if m.Age != 0 { |
| 635 |
n += 1 + sovTypedecl(uint64(m.Age)) |
| 636 |
} |
| 637 |
return n |
| 638 |
} |
| 639 |
|
| 640 |
func sovTypedecl(x uint64) (n int) { |
| 641 |
return (math_bits.Len64(x|1) + 6) / 7 |
| 642 |
} |
| 643 |
func sozTypedecl(x uint64) (n int) { |
| 644 |
return sovTypedecl(uint64((x << 1) ^ uint64((int64(x) >> 63)))) |
| 645 |
} |
| 646 |
func (m *Dropped) Unmarshal(dAtA []byte) error { |
| 647 |
l := len(dAtA) |
| 648 |
iNdEx := 0 |
| 649 |
for iNdEx < l { |
| 650 |
preIndex := iNdEx |
| 651 |
var wire uint64 |
| 652 |
for shift := uint(0); ; shift += 7 { |
| 653 |
if shift >= 64 { |
| 654 |
return ErrIntOverflowTypedecl |
| 655 |
} |
| 656 |
if iNdEx >= l { |
| 657 |
return io.ErrUnexpectedEOF |
| 658 |
} |
| 659 |
b := dAtA[iNdEx] |
| 660 |
iNdEx++ |
| 661 |
wire |= uint64(b&0x7F) << shift |
| 662 |
if b < 0x80 { |
| 663 |
break |
| 664 |
} |
| 665 |
} |
| 666 |
fieldNum := int32(wire >> 3) |
| 667 |
wireType := int(wire & 0x7) |
| 668 |
if wireType == 4 { |
| 669 |
return fmt.Errorf("proto: Dropped: wiretype end group for non-group") |
| 670 |
} |
| 671 |
if fieldNum <= 0 { |
| 672 |
return fmt.Errorf("proto: Dropped: illegal tag %d (wire type %d)", fieldNum, wire) |
| 673 |
} |
| 674 |
switch fieldNum { |
| 675 |
case 1: |
| 676 |
if wireType != 2 { |
| 677 |
return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) |
| 678 |
} |
| 679 |
var stringLen uint64 |
| 680 |
for shift := uint(0); ; shift += 7 { |
| 681 |
if shift >= 64 { |
| 682 |
return ErrIntOverflowTypedecl |
| 683 |
} |
| 684 |
if iNdEx >= l { |
| 685 |
return io.ErrUnexpectedEOF |
| 686 |
} |
| 687 |
b := dAtA[iNdEx] |
| 688 |
iNdEx++ |
| 689 |
stringLen |= uint64(b&0x7F) << shift |
| 690 |
if b < 0x80 { |
| 691 |
break |
| 692 |
} |
| 693 |
} |
| 694 |
intStringLen := int(stringLen) |
| 695 |
if intStringLen < 0 { |
| 696 |
return ErrInvalidLengthTypedecl |
| 697 |
} |
| 698 |
postIndex := iNdEx + intStringLen |
| 699 |
if postIndex < 0 { |
| 700 |
return ErrInvalidLengthTypedecl |
| 701 |
} |
| 702 |
if postIndex > l { |
| 703 |
return io.ErrUnexpectedEOF |
| 704 |
} |
| 705 |
m.Name = string(dAtA[iNdEx:postIndex]) |
| 706 |
iNdEx = postIndex |
| 707 |
case 2: |
| 708 |
if wireType != 0 { |
| 709 |
return fmt.Errorf("proto: wrong wireType = %d for field Age", wireType) |
| 710 |
} |
| 711 |
m.Age = 0 |
| 712 |
for shift := uint(0); ; shift += 7 { |
| 713 |
if shift >= 64 { |
| 714 |
return ErrIntOverflowTypedecl |
| 715 |
} |
| 716 |
if iNdEx >= l { |
| 717 |
return io.ErrUnexpectedEOF |
| 718 |
} |
| 719 |
b := dAtA[iNdEx] |
| 720 |
iNdEx++ |
| 721 |
m.Age |= int32(b&0x7F) << shift |
| 722 |
if b < 0x80 { |
| 723 |
break |
| 724 |
} |
| 725 |
} |
| 726 |
default: |
| 727 |
iNdEx = preIndex |
| 728 |
skippy, err := skipTypedecl(dAtA[iNdEx:]) |
| 729 |
if err != nil { |
| 730 |
return err |
| 731 |
} |
| 732 |
if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 733 |
return ErrInvalidLengthTypedecl |
| 734 |
} |
| 735 |
if (iNdEx + skippy) > l { |
| 736 |
return io.ErrUnexpectedEOF |
| 737 |
} |
| 738 |
iNdEx += skippy |
| 739 |
} |
| 740 |
} |
| 741 |
|
| 742 |
if iNdEx > l { |
| 743 |
return io.ErrUnexpectedEOF |
| 744 |
} |
| 745 |
return nil |
| 746 |
} |
| 747 |
func (m *DroppedWithoutGetters) Unmarshal(dAtA []byte) error { |
| 748 |
l := len(dAtA) |
| 749 |
iNdEx := 0 |
| 750 |
for iNdEx < l { |
| 751 |
preIndex := iNdEx |
| 752 |
var wire uint64 |
| 753 |
for shift := uint(0); ; shift += 7 { |
| 754 |
if shift >= 64 { |
| 755 |
return ErrIntOverflowTypedecl |
| 756 |
} |
| 757 |
if iNdEx >= l { |
| 758 |
return io.ErrUnexpectedEOF |
| 759 |
} |
| 760 |
b := dAtA[iNdEx] |
| 761 |
iNdEx++ |
| 762 |
wire |= uint64(b&0x7F) << shift |
| 763 |
if b < 0x80 { |
| 764 |
break |
| 765 |
} |
| 766 |
} |
| 767 |
fieldNum := int32(wire >> 3) |
| 768 |
wireType := int(wire & 0x7) |
| 769 |
if wireType == 4 { |
| 770 |
return fmt.Errorf("proto: DroppedWithoutGetters: wiretype end group for non-group") |
| 771 |
} |
| 772 |
if fieldNum <= 0 { |
| 773 |
return fmt.Errorf("proto: DroppedWithoutGetters: illegal tag %d (wire type %d)", fieldNum, wire) |
| 774 |
} |
| 775 |
switch fieldNum { |
| 776 |
case 1: |
| 777 |
if wireType != 0 { |
| 778 |
return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) |
| 779 |
} |
| 780 |
m.Height = 0 |
| 781 |
for shift := uint(0); ; shift += 7 { |
| 782 |
if shift >= 64 { |
| 783 |
return ErrIntOverflowTypedecl |
| 784 |
} |
| 785 |
if iNdEx >= l { |
| 786 |
return io.ErrUnexpectedEOF |
| 787 |
} |
| 788 |
b := dAtA[iNdEx] |
| 789 |
iNdEx++ |
| 790 |
m.Height |= int64(b&0x7F) << shift |
| 791 |
if b < 0x80 { |
| 792 |
break |
| 793 |
} |
| 794 |
} |
| 795 |
case 2: |
| 796 |
if wireType != 0 { |
| 797 |
return fmt.Errorf("proto: wrong wireType = %d for field Width", wireType) |
| 798 |
} |
| 799 |
m.Width = 0 |
| 800 |
for shift := uint(0); ; shift += 7 { |
| 801 |
if shift >= 64 { |
| 802 |
return ErrIntOverflowTypedecl |
| 803 |
} |
| 804 |
if iNdEx >= l { |
| 805 |
return io.ErrUnexpectedEOF |
| 806 |
} |
| 807 |
b := dAtA[iNdEx] |
| 808 |
iNdEx++ |
| 809 |
m.Width |= int64(b&0x7F) << shift |
| 810 |
if b < 0x80 { |
| 811 |
break |
| 812 |
} |
| 813 |
} |
| 814 |
default: |
| 815 |
iNdEx = preIndex |
| 816 |
skippy, err := skipTypedecl(dAtA[iNdEx:]) |
| 817 |
if err != nil { |
| 818 |
return err |
| 819 |
} |
| 820 |
if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 821 |
return ErrInvalidLengthTypedecl |
| 822 |
} |
| 823 |
if (iNdEx + skippy) > l { |
| 824 |
return io.ErrUnexpectedEOF |
| 825 |
} |
| 826 |
iNdEx += skippy |
| 827 |
} |
| 828 |
} |
| 829 |
|
| 830 |
if iNdEx > l { |
| 831 |
return io.ErrUnexpectedEOF |
| 832 |
} |
| 833 |
return nil |
| 834 |
} |
| 835 |
func (m *Kept) Unmarshal(dAtA []byte) error { |
| 836 |
l := len(dAtA) |
| 837 |
iNdEx := 0 |
| 838 |
for iNdEx < l { |
| 839 |
preIndex := iNdEx |
| 840 |
var wire uint64 |
| 841 |
for shift := uint(0); ; shift += 7 { |
| 842 |
if shift >= 64 { |
| 843 |
return ErrIntOverflowTypedecl |
| 844 |
} |
| 845 |
if iNdEx >= l { |
| 846 |
return io.ErrUnexpectedEOF |
| 847 |
} |
| 848 |
b := dAtA[iNdEx] |
| 849 |
iNdEx++ |
| 850 |
wire |= uint64(b&0x7F) << shift |
| 851 |
if b < 0x80 { |
| 852 |
break |
| 853 |
} |
| 854 |
} |
| 855 |
fieldNum := int32(wire >> 3) |
| 856 |
wireType := int(wire & 0x7) |
| 857 |
if wireType == 4 { |
| 858 |
return fmt.Errorf("proto: Kept: wiretype end group for non-group") |
| 859 |
} |
| 860 |
if fieldNum <= 0 { |
| 861 |
return fmt.Errorf("proto: Kept: illegal tag %d (wire type %d)", fieldNum, wire) |
| 862 |
} |
| 863 |
switch fieldNum { |
| 864 |
case 1: |
| 865 |
if wireType != 2 { |
| 866 |
return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) |
| 867 |
} |
| 868 |
var stringLen uint64 |
| 869 |
for shift := uint(0); ; shift += 7 { |
| 870 |
if shift >= 64 { |
| 871 |
return ErrIntOverflowTypedecl |
| 872 |
} |
| 873 |
if iNdEx >= l { |
| 874 |
return io.ErrUnexpectedEOF |
| 875 |
} |
| 876 |
b := dAtA[iNdEx] |
| 877 |
iNdEx++ |
| 878 |
stringLen |= uint64(b&0x7F) << shift |
| 879 |
if b < 0x80 { |
| 880 |
break |
| 881 |
} |
| 882 |
} |
| 883 |
intStringLen := int(stringLen) |
| 884 |
if intStringLen < 0 { |
| 885 |
return ErrInvalidLengthTypedecl |
| 886 |
} |
| 887 |
postIndex := iNdEx + intStringLen |
| 888 |
if postIndex < 0 { |
| 889 |
return ErrInvalidLengthTypedecl |
| 890 |
} |
| 891 |
if postIndex > l { |
| 892 |
return io.ErrUnexpectedEOF |
| 893 |
} |
| 894 |
m.Name = string(dAtA[iNdEx:postIndex]) |
| 895 |
iNdEx = postIndex |
| 896 |
case 2: |
| 897 |
if wireType != 0 { |
| 898 |
return fmt.Errorf("proto: wrong wireType = %d for field Age", wireType) |
| 899 |
} |
| 900 |
m.Age = 0 |
| 901 |
for shift := uint(0); ; shift += 7 { |
| 902 |
if shift >= 64 { |
| 903 |
return ErrIntOverflowTypedecl |
| 904 |
} |
| 905 |
if iNdEx >= l { |
| 906 |
return io.ErrUnexpectedEOF |
| 907 |
} |
| 908 |
b := dAtA[iNdEx] |
| 909 |
iNdEx++ |
| 910 |
m.Age |= int32(b&0x7F) << shift |
| 911 |
if b < 0x80 { |
| 912 |
break |
| 913 |
} |
| 914 |
} |
| 915 |
default: |
| 916 |
iNdEx = preIndex |
| 917 |
skippy, err := skipTypedecl(dAtA[iNdEx:]) |
| 918 |
if err != nil { |
| 919 |
return err |
| 920 |
} |
| 921 |
if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 922 |
return ErrInvalidLengthTypedecl |
| 923 |
} |
| 924 |
if (iNdEx + skippy) > l { |
| 925 |
return io.ErrUnexpectedEOF |
| 926 |
} |
| 927 |
iNdEx += skippy |
| 928 |
} |
| 929 |
} |
| 930 |
|
| 931 |
if iNdEx > l { |
| 932 |
return io.ErrUnexpectedEOF |
| 933 |
} |
| 934 |
return nil |
| 935 |
} |
| 936 |
func skipTypedecl(dAtA []byte) (n int, err error) { |
| 937 |
l := len(dAtA) |
| 938 |
iNdEx := 0 |
| 939 |
depth := 0 |
| 940 |
for iNdEx < l { |
| 941 |
var wire uint64 |
| 942 |
for shift := uint(0); ; shift += 7 { |
| 943 |
if shift >= 64 { |
| 944 |
return 0, ErrIntOverflowTypedecl |
| 945 |
} |
| 946 |
if iNdEx >= l { |
| 947 |
return 0, io.ErrUnexpectedEOF |
| 948 |
} |
| 949 |
b := dAtA[iNdEx] |
| 950 |
iNdEx++ |
| 951 |
wire |= (uint64(b) & 0x7F) << shift |
| 952 |
if b < 0x80 { |
| 953 |
break |
| 954 |
} |
| 955 |
} |
| 956 |
wireType := int(wire & 0x7) |
| 957 |
switch wireType { |
| 958 |
case 0: |
| 959 |
for shift := uint(0); ; shift += 7 { |
| 960 |
if shift >= 64 { |
| 961 |
return 0, ErrIntOverflowTypedecl |
| 962 |
} |
| 963 |
if iNdEx >= l { |
| 964 |
return 0, io.ErrUnexpectedEOF |
| 965 |
} |
| 966 |
iNdEx++ |
| 967 |
if dAtA[iNdEx-1] < 0x80 { |
| 968 |
break |
| 969 |
} |
| 970 |
} |
| 971 |
case 1: |
| 972 |
iNdEx += 8 |
| 973 |
case 2: |
| 974 |
var length int |
| 975 |
for shift := uint(0); ; shift += 7 { |
| 976 |
if shift >= 64 { |
| 977 |
return 0, ErrIntOverflowTypedecl |
| 978 |
} |
| 979 |
if iNdEx >= l { |
| 980 |
return 0, io.ErrUnexpectedEOF |
| 981 |
} |
| 982 |
b := dAtA[iNdEx] |
| 983 |
iNdEx++ |
| 984 |
length |= (int(b) & 0x7F) << shift |
| 985 |
if b < 0x80 { |
| 986 |
break |
| 987 |
} |
| 988 |
} |
| 989 |
if length < 0 { |
| 990 |
return 0, ErrInvalidLengthTypedecl |
| 991 |
} |
| 992 |
iNdEx += length |
| 993 |
case 3: |
| 994 |
depth++ |
| 995 |
case 4: |
| 996 |
if depth == 0 { |
| 997 |
return 0, ErrUnexpectedEndOfGroupTypedecl |
| 998 |
} |
| 999 |
depth-- |
| 1000 |
case 5: |
| 1001 |
iNdEx += 4 |
| 1002 |
default: |
| 1003 |
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) |
| 1004 |
} |
| 1005 |
if iNdEx < 0 { |
| 1006 |
return 0, ErrInvalidLengthTypedecl |
| 1007 |
} |
| 1008 |
if depth == 0 { |
| 1009 |
return iNdEx, nil |
| 1010 |
} |
| 1011 |
} |
| 1012 |
return 0, io.ErrUnexpectedEOF |
| 1013 |
} |
| 1014 |
|
| 1015 |
var ( |
| 1016 |
ErrInvalidLengthTypedecl = fmt.Errorf("proto: negative length found during unmarshaling") |
| 1017 |
ErrIntOverflowTypedecl = fmt.Errorf("proto: integer overflow") |
| 1018 |
ErrUnexpectedEndOfGroupTypedecl = fmt.Errorf("proto: unexpected end of group") |
| 1019 |
) |