| 1443 | return nil |
| 1444 | } |
| 1445 | func (m *NodePb) Unmarshal(data []byte) error { |
| 1446 | l := len(data) |
| 1447 | iNdEx := 0 |
| 1448 | for iNdEx < l { |
| 1449 | preIndex := iNdEx |
| 1450 | var wire uint64 |
| 1451 | for shift := uint(0); ; shift += 7 { |
| 1452 | if shift >= 64 { |
| 1453 | return ErrIntOverflowNode |
| 1454 | } |
| 1455 | if iNdEx >= l { |
| 1456 | return io.ErrUnexpectedEOF |
| 1457 | } |
| 1458 | b := data[iNdEx] |
| 1459 | iNdEx++ |
| 1460 | wire |= (uint64(b) & 0x7F) << shift |
| 1461 | if b < 0x80 { |
| 1462 | break |
| 1463 | } |
| 1464 | } |
| 1465 | fieldNum := int32(wire >> 3) |
| 1466 | wireType := int(wire & 0x7) |
| 1467 | if wireType == 4 { |
| 1468 | return fmt.Errorf("proto: NodePb: wiretype end group for non-group") |
| 1469 | } |
| 1470 | if fieldNum <= 0 { |
| 1471 | return fmt.Errorf("proto: NodePb: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1472 | } |
| 1473 | switch fieldNum { |
| 1474 | case 1: |
| 1475 | if wireType != 2 { |
| 1476 | return fmt.Errorf("proto: wrong wireType = %d for field Bn", wireType) |
| 1477 | } |
| 1478 | var msglen int |
| 1479 | for shift := uint(0); ; shift += 7 { |
| 1480 | if shift >= 64 { |
| 1481 | return ErrIntOverflowNode |
| 1482 | } |
| 1483 | if iNdEx >= l { |
| 1484 | return io.ErrUnexpectedEOF |
| 1485 | } |
| 1486 | b := data[iNdEx] |
| 1487 | iNdEx++ |
| 1488 | msglen |= (int(b) & 0x7F) << shift |
| 1489 | if b < 0x80 { |
| 1490 | break |
| 1491 | } |
| 1492 | } |
| 1493 | if msglen < 0 { |
| 1494 | return ErrInvalidLengthNode |
| 1495 | } |
| 1496 | postIndex := iNdEx + msglen |
| 1497 | if postIndex > l { |
| 1498 | return io.ErrUnexpectedEOF |
| 1499 | } |
| 1500 | if m.Bn == nil { |
| 1501 | m.Bn = &BinaryNodePb{} |
| 1502 | } |