github.com/gogo/protobuf@v1.3.2/test/issue449/issue449.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: issue449.proto 3 4 package issue449 5 6 import ( 7 bytes "bytes" 8 fmt "fmt" 9 _ "github.com/gogo/protobuf/gogoproto" 10 github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" 11 proto "github.com/gogo/protobuf/proto" 12 io "io" 13 math "math" 14 math_bits "math/bits" 15 ) 16 17 // Reference imports to suppress errors if they are not otherwise used. 18 var _ = proto.Marshal 19 var _ = fmt.Errorf 20 var _ = math.Inf 21 22 // This is a compile-time assertion to ensure that this generated file 23 // is compatible with the proto package it is being compiled against. 24 // A compilation error at this line likely means your copy of the 25 // proto package needs to be updated. 26 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 27 28 type CodeGenMsg struct { 29 Int64ReqPtr *int64 `protobuf:"varint,1,req,name=Int64ReqPtr" json:"Int64ReqPtr,omitempty"` 30 Int32OptPtr *int32 `protobuf:"varint,2,opt,name=Int32OptPtr" json:"Int32OptPtr,omitempty"` 31 Int64Req int64 `protobuf:"varint,3,req,name=Int64Req" json:"Int64Req"` 32 Int32Opt int32 `protobuf:"varint,4,opt,name=Int32Opt" json:"Int32Opt"` 33 XXX_NoUnkeyedLiteral struct{} `json:"-"` 34 XXX_unrecognized []byte `json:"-"` 35 XXX_sizecache int32 `json:"-"` 36 } 37 38 func (m *CodeGenMsg) Reset() { *m = CodeGenMsg{} } 39 func (m *CodeGenMsg) String() string { return proto.CompactTextString(m) } 40 func (*CodeGenMsg) ProtoMessage() {} 41 func (*CodeGenMsg) Descriptor() ([]byte, []int) { 42 return fileDescriptor_dece653619274e1d, []int{0} 43 } 44 func (m *CodeGenMsg) XXX_Unmarshal(b []byte) error { 45 return m.Unmarshal(b) 46 } 47 func (m *CodeGenMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 48 if deterministic { 49 return xxx_messageInfo_CodeGenMsg.Marshal(b, m, deterministic) 50 } else { 51 b = b[:cap(b)] 52 n, err := m.MarshalToSizedBuffer(b) 53 if err != nil { 54 return nil, err 55 } 56 return b[:n], nil 57 } 58 } 59 func (m *CodeGenMsg) XXX_Merge(src proto.Message) { 60 xxx_messageInfo_CodeGenMsg.Merge(m, src) 61 } 62 func (m *CodeGenMsg) XXX_Size() int { 63 return m.Size() 64 } 65 func (m *CodeGenMsg) XXX_DiscardUnknown() { 66 xxx_messageInfo_CodeGenMsg.DiscardUnknown(m) 67 } 68 69 var xxx_messageInfo_CodeGenMsg proto.InternalMessageInfo 70 71 func (m *CodeGenMsg) GetInt64ReqPtr() int64 { 72 if m != nil && m.Int64ReqPtr != nil { 73 return *m.Int64ReqPtr 74 } 75 return 0 76 } 77 78 func (m *CodeGenMsg) GetInt32OptPtr() int32 { 79 if m != nil && m.Int32OptPtr != nil { 80 return *m.Int32OptPtr 81 } 82 return 0 83 } 84 85 func (m *CodeGenMsg) GetInt64Req() int64 { 86 if m != nil { 87 return m.Int64Req 88 } 89 return 0 90 } 91 92 func (m *CodeGenMsg) GetInt32Opt() int32 { 93 if m != nil { 94 return m.Int32Opt 95 } 96 return 0 97 } 98 99 type NonCodeGenMsg struct { 100 Int64ReqPtr *int64 `protobuf:"varint,1,req,name=Int64ReqPtr" json:"Int64ReqPtr,omitempty"` 101 Int32OptPtr *int32 `protobuf:"varint,2,opt,name=Int32OptPtr" json:"Int32OptPtr,omitempty"` 102 Int64Req int64 `protobuf:"varint,3,req,name=Int64Req" json:"Int64Req"` 103 Int32Opt int32 `protobuf:"varint,4,opt,name=Int32Opt" json:"Int32Opt"` 104 XXX_NoUnkeyedLiteral struct{} `json:"-"` 105 XXX_unrecognized []byte `json:"-"` 106 XXX_sizecache int32 `json:"-"` 107 } 108 109 func (m *NonCodeGenMsg) Reset() { *m = NonCodeGenMsg{} } 110 func (m *NonCodeGenMsg) String() string { return proto.CompactTextString(m) } 111 func (*NonCodeGenMsg) ProtoMessage() {} 112 func (*NonCodeGenMsg) Descriptor() ([]byte, []int) { 113 return fileDescriptor_dece653619274e1d, []int{1} 114 } 115 func (m *NonCodeGenMsg) XXX_Unmarshal(b []byte) error { 116 return xxx_messageInfo_NonCodeGenMsg.Unmarshal(m, b) 117 } 118 func (m *NonCodeGenMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 119 return xxx_messageInfo_NonCodeGenMsg.Marshal(b, m, deterministic) 120 } 121 func (m *NonCodeGenMsg) XXX_Merge(src proto.Message) { 122 xxx_messageInfo_NonCodeGenMsg.Merge(m, src) 123 } 124 func (m *NonCodeGenMsg) XXX_Size() int { 125 return xxx_messageInfo_NonCodeGenMsg.Size(m) 126 } 127 func (m *NonCodeGenMsg) XXX_DiscardUnknown() { 128 xxx_messageInfo_NonCodeGenMsg.DiscardUnknown(m) 129 } 130 131 var xxx_messageInfo_NonCodeGenMsg proto.InternalMessageInfo 132 133 func (m *NonCodeGenMsg) GetInt64ReqPtr() int64 { 134 if m != nil && m.Int64ReqPtr != nil { 135 return *m.Int64ReqPtr 136 } 137 return 0 138 } 139 140 func (m *NonCodeGenMsg) GetInt32OptPtr() int32 { 141 if m != nil && m.Int32OptPtr != nil { 142 return *m.Int32OptPtr 143 } 144 return 0 145 } 146 147 func (m *NonCodeGenMsg) GetInt64Req() int64 { 148 if m != nil { 149 return m.Int64Req 150 } 151 return 0 152 } 153 154 func (m *NonCodeGenMsg) GetInt32Opt() int32 { 155 if m != nil { 156 return m.Int32Opt 157 } 158 return 0 159 } 160 161 func init() { 162 proto.RegisterType((*CodeGenMsg)(nil), "issue449.CodeGenMsg") 163 proto.RegisterType((*NonCodeGenMsg)(nil), "issue449.NonCodeGenMsg") 164 } 165 166 func init() { proto.RegisterFile("issue449.proto", fileDescriptor_dece653619274e1d) } 167 168 var fileDescriptor_dece653619274e1d = []byte{ 169 // 203 bytes of a gzipped FileDescriptorProto 170 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcb, 0x2c, 0x2e, 0x2e, 171 0x4d, 0x35, 0x31, 0xb1, 0xd4, 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, 0x5a, 0xc4, 0xc8, 174 0xc5, 0xe5, 0x9c, 0x9f, 0x92, 0xea, 0x9e, 0x9a, 0xe7, 0x5b, 0x9c, 0x2e, 0xa4, 0xc0, 0xc5, 0xed, 175 0x99, 0x57, 0x62, 0x66, 0x12, 0x94, 0x5a, 0x18, 0x50, 0x52, 0x24, 0xc1, 0xa8, 0xc0, 0xa4, 0xc1, 176 0x1c, 0x84, 0x2c, 0x04, 0x55, 0x61, 0x6c, 0xe4, 0x5f, 0x50, 0x02, 0x52, 0xc1, 0xa4, 0xc0, 0xa8, 177 0xc1, 0x1a, 0x84, 0x2c, 0x24, 0xa4, 0xc0, 0xc5, 0x01, 0xd3, 0x20, 0xc1, 0x0c, 0x32, 0xc0, 0x89, 178 0xe5, 0xc4, 0x3d, 0x79, 0x86, 0x20, 0xb8, 0x28, 0x54, 0x05, 0x58, 0x83, 0x04, 0x0b, 0xc8, 0x00, 179 0x24, 0x15, 0x60, 0x51, 0x2b, 0x9e, 0x8e, 0x85, 0xf2, 0x8c, 0x13, 0x16, 0xca, 0x33, 0x2e, 0x58, 180 0x28, 0xcf, 0xa8, 0xb4, 0x94, 0x91, 0x8b, 0xd7, 0x2f, 0x3f, 0x6f, 0x90, 0xba, 0x93, 0x61, 0xc2, 181 0x42, 0x79, 0x86, 0x05, 0x0b, 0xe5, 0x19, 0x9c, 0x58, 0x56, 0x3c, 0x92, 0x63, 0x04, 0x04, 0x00, 182 0x00, 0xff, 0xff, 0xfd, 0x5a, 0xe2, 0x72, 0x9c, 0x01, 0x00, 0x00, 183 } 184 185 func (this *CodeGenMsg) Equal(that interface{}) bool { 186 if that == nil { 187 return this == nil 188 } 189 190 that1, ok := that.(*CodeGenMsg) 191 if !ok { 192 that2, ok := that.(CodeGenMsg) 193 if ok { 194 that1 = &that2 195 } else { 196 return false 197 } 198 } 199 if that1 == nil { 200 return this == nil 201 } else if this == nil { 202 return false 203 } 204 if this.Int64ReqPtr != nil && that1.Int64ReqPtr != nil { 205 if *this.Int64ReqPtr != *that1.Int64ReqPtr { 206 return false 207 } 208 } else if this.Int64ReqPtr != nil { 209 return false 210 } else if that1.Int64ReqPtr != nil { 211 return false 212 } 213 if this.Int32OptPtr != nil && that1.Int32OptPtr != nil { 214 if *this.Int32OptPtr != *that1.Int32OptPtr { 215 return false 216 } 217 } else if this.Int32OptPtr != nil { 218 return false 219 } else if that1.Int32OptPtr != nil { 220 return false 221 } 222 if this.Int64Req != that1.Int64Req { 223 return false 224 } 225 if this.Int32Opt != that1.Int32Opt { 226 return false 227 } 228 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 229 return false 230 } 231 return true 232 } 233 func (this *NonCodeGenMsg) Equal(that interface{}) bool { 234 if that == nil { 235 return this == nil 236 } 237 238 that1, ok := that.(*NonCodeGenMsg) 239 if !ok { 240 that2, ok := that.(NonCodeGenMsg) 241 if ok { 242 that1 = &that2 243 } else { 244 return false 245 } 246 } 247 if that1 == nil { 248 return this == nil 249 } else if this == nil { 250 return false 251 } 252 if this.Int64ReqPtr != nil && that1.Int64ReqPtr != nil { 253 if *this.Int64ReqPtr != *that1.Int64ReqPtr { 254 return false 255 } 256 } else if this.Int64ReqPtr != nil { 257 return false 258 } else if that1.Int64ReqPtr != nil { 259 return false 260 } 261 if this.Int32OptPtr != nil && that1.Int32OptPtr != nil { 262 if *this.Int32OptPtr != *that1.Int32OptPtr { 263 return false 264 } 265 } else if this.Int32OptPtr != nil { 266 return false 267 } else if that1.Int32OptPtr != nil { 268 return false 269 } 270 if this.Int64Req != that1.Int64Req { 271 return false 272 } 273 if this.Int32Opt != that1.Int32Opt { 274 return false 275 } 276 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 277 return false 278 } 279 return true 280 } 281 func (m *CodeGenMsg) Marshal() (dAtA []byte, err error) { 282 size := m.Size() 283 dAtA = make([]byte, size) 284 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 285 if err != nil { 286 return nil, err 287 } 288 return dAtA[:n], nil 289 } 290 291 func (m *CodeGenMsg) MarshalTo(dAtA []byte) (int, error) { 292 size := m.Size() 293 return m.MarshalToSizedBuffer(dAtA[:size]) 294 } 295 296 func (m *CodeGenMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { 297 i := len(dAtA) 298 _ = i 299 var l int 300 _ = l 301 if m.XXX_unrecognized != nil { 302 i -= len(m.XXX_unrecognized) 303 copy(dAtA[i:], m.XXX_unrecognized) 304 } 305 i = encodeVarintIssue449(dAtA, i, uint64(m.Int32Opt)) 306 i-- 307 dAtA[i] = 0x20 308 i = encodeVarintIssue449(dAtA, i, uint64(m.Int64Req)) 309 i-- 310 dAtA[i] = 0x18 311 if m.Int32OptPtr != nil { 312 i = encodeVarintIssue449(dAtA, i, uint64(*m.Int32OptPtr)) 313 i-- 314 dAtA[i] = 0x10 315 } 316 if m.Int64ReqPtr == nil { 317 return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("Int64ReqPtr") 318 } else { 319 i = encodeVarintIssue449(dAtA, i, uint64(*m.Int64ReqPtr)) 320 i-- 321 dAtA[i] = 0x8 322 } 323 return len(dAtA) - i, nil 324 } 325 326 func encodeVarintIssue449(dAtA []byte, offset int, v uint64) int { 327 offset -= sovIssue449(v) 328 base := offset 329 for v >= 1<<7 { 330 dAtA[offset] = uint8(v&0x7f | 0x80) 331 v >>= 7 332 offset++ 333 } 334 dAtA[offset] = uint8(v) 335 return base 336 } 337 func (m *CodeGenMsg) Size() (n int) { 338 if m == nil { 339 return 0 340 } 341 var l int 342 _ = l 343 if m.Int64ReqPtr != nil { 344 n += 1 + sovIssue449(uint64(*m.Int64ReqPtr)) 345 } 346 if m.Int32OptPtr != nil { 347 n += 1 + sovIssue449(uint64(*m.Int32OptPtr)) 348 } 349 n += 1 + sovIssue449(uint64(m.Int64Req)) 350 n += 1 + sovIssue449(uint64(m.Int32Opt)) 351 if m.XXX_unrecognized != nil { 352 n += len(m.XXX_unrecognized) 353 } 354 return n 355 } 356 357 func sovIssue449(x uint64) (n int) { 358 return (math_bits.Len64(x|1) + 6) / 7 359 } 360 func sozIssue449(x uint64) (n int) { 361 return sovIssue449(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 362 } 363 func (m *CodeGenMsg) Unmarshal(dAtA []byte) error { 364 var hasFields [1]uint64 365 l := len(dAtA) 366 iNdEx := 0 367 for iNdEx < l { 368 preIndex := iNdEx 369 var wire uint64 370 for shift := uint(0); ; shift += 7 { 371 if shift >= 64 { 372 return ErrIntOverflowIssue449 373 } 374 if iNdEx >= l { 375 return io.ErrUnexpectedEOF 376 } 377 b := dAtA[iNdEx] 378 iNdEx++ 379 wire |= uint64(b&0x7F) << shift 380 if b < 0x80 { 381 break 382 } 383 } 384 fieldNum := int32(wire >> 3) 385 wireType := int(wire & 0x7) 386 if wireType == 4 { 387 return fmt.Errorf("proto: CodeGenMsg: wiretype end group for non-group") 388 } 389 if fieldNum <= 0 { 390 return fmt.Errorf("proto: CodeGenMsg: illegal tag %d (wire type %d)", fieldNum, wire) 391 } 392 switch fieldNum { 393 case 1: 394 if wireType != 0 { 395 return fmt.Errorf("proto: wrong wireType = %d for field Int64ReqPtr", wireType) 396 } 397 var v int64 398 for shift := uint(0); ; shift += 7 { 399 if shift >= 64 { 400 return ErrIntOverflowIssue449 401 } 402 if iNdEx >= l { 403 return io.ErrUnexpectedEOF 404 } 405 b := dAtA[iNdEx] 406 iNdEx++ 407 v |= int64(b&0x7F) << shift 408 if b < 0x80 { 409 break 410 } 411 } 412 m.Int64ReqPtr = &v 413 hasFields[0] |= uint64(0x00000001) 414 case 2: 415 if wireType != 0 { 416 return fmt.Errorf("proto: wrong wireType = %d for field Int32OptPtr", wireType) 417 } 418 var v int32 419 for shift := uint(0); ; shift += 7 { 420 if shift >= 64 { 421 return ErrIntOverflowIssue449 422 } 423 if iNdEx >= l { 424 return io.ErrUnexpectedEOF 425 } 426 b := dAtA[iNdEx] 427 iNdEx++ 428 v |= int32(b&0x7F) << shift 429 if b < 0x80 { 430 break 431 } 432 } 433 m.Int32OptPtr = &v 434 case 3: 435 if wireType != 0 { 436 return fmt.Errorf("proto: wrong wireType = %d for field Int64Req", wireType) 437 } 438 m.Int64Req = 0 439 for shift := uint(0); ; shift += 7 { 440 if shift >= 64 { 441 return ErrIntOverflowIssue449 442 } 443 if iNdEx >= l { 444 return io.ErrUnexpectedEOF 445 } 446 b := dAtA[iNdEx] 447 iNdEx++ 448 m.Int64Req |= int64(b&0x7F) << shift 449 if b < 0x80 { 450 break 451 } 452 } 453 hasFields[0] |= uint64(0x00000002) 454 case 4: 455 if wireType != 0 { 456 return fmt.Errorf("proto: wrong wireType = %d for field Int32Opt", wireType) 457 } 458 m.Int32Opt = 0 459 for shift := uint(0); ; shift += 7 { 460 if shift >= 64 { 461 return ErrIntOverflowIssue449 462 } 463 if iNdEx >= l { 464 return io.ErrUnexpectedEOF 465 } 466 b := dAtA[iNdEx] 467 iNdEx++ 468 m.Int32Opt |= int32(b&0x7F) << shift 469 if b < 0x80 { 470 break 471 } 472 } 473 default: 474 iNdEx = preIndex 475 skippy, err := skipIssue449(dAtA[iNdEx:]) 476 if err != nil { 477 return err 478 } 479 if (skippy < 0) || (iNdEx+skippy) < 0 { 480 return ErrInvalidLengthIssue449 481 } 482 if (iNdEx + skippy) > l { 483 return io.ErrUnexpectedEOF 484 } 485 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 486 iNdEx += skippy 487 } 488 } 489 if hasFields[0]&uint64(0x00000001) == 0 { 490 return github_com_gogo_protobuf_proto.NewRequiredNotSetError("Int64ReqPtr") 491 } 492 if hasFields[0]&uint64(0x00000002) == 0 { 493 return github_com_gogo_protobuf_proto.NewRequiredNotSetError("Int64Req") 494 } 495 496 if iNdEx > l { 497 return io.ErrUnexpectedEOF 498 } 499 return nil 500 } 501 func skipIssue449(dAtA []byte) (n int, err error) { 502 l := len(dAtA) 503 iNdEx := 0 504 depth := 0 505 for iNdEx < l { 506 var wire uint64 507 for shift := uint(0); ; shift += 7 { 508 if shift >= 64 { 509 return 0, ErrIntOverflowIssue449 510 } 511 if iNdEx >= l { 512 return 0, io.ErrUnexpectedEOF 513 } 514 b := dAtA[iNdEx] 515 iNdEx++ 516 wire |= (uint64(b) & 0x7F) << shift 517 if b < 0x80 { 518 break 519 } 520 } 521 wireType := int(wire & 0x7) 522 switch wireType { 523 case 0: 524 for shift := uint(0); ; shift += 7 { 525 if shift >= 64 { 526 return 0, ErrIntOverflowIssue449 527 } 528 if iNdEx >= l { 529 return 0, io.ErrUnexpectedEOF 530 } 531 iNdEx++ 532 if dAtA[iNdEx-1] < 0x80 { 533 break 534 } 535 } 536 case 1: 537 iNdEx += 8 538 case 2: 539 var length int 540 for shift := uint(0); ; shift += 7 { 541 if shift >= 64 { 542 return 0, ErrIntOverflowIssue449 543 } 544 if iNdEx >= l { 545 return 0, io.ErrUnexpectedEOF 546 } 547 b := dAtA[iNdEx] 548 iNdEx++ 549 length |= (int(b) & 0x7F) << shift 550 if b < 0x80 { 551 break 552 } 553 } 554 if length < 0 { 555 return 0, ErrInvalidLengthIssue449 556 } 557 iNdEx += length 558 case 3: 559 depth++ 560 case 4: 561 if depth == 0 { 562 return 0, ErrUnexpectedEndOfGroupIssue449 563 } 564 depth-- 565 case 5: 566 iNdEx += 4 567 default: 568 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 569 } 570 if iNdEx < 0 { 571 return 0, ErrInvalidLengthIssue449 572 } 573 if depth == 0 { 574 return iNdEx, nil 575 } 576 } 577 return 0, io.ErrUnexpectedEOF 578 } 579 580 var ( 581 ErrInvalidLengthIssue449 = fmt.Errorf("proto: negative length found during unmarshaling") 582 ErrIntOverflowIssue449 = fmt.Errorf("proto: integer overflow") 583 ErrUnexpectedEndOfGroupIssue449 = fmt.Errorf("proto: unexpected end of group") 584 )