(data []byte)
| 711 | } |
| 712 | |
| 713 | func (m *SqlStatementPb) MarshalTo(data []byte) (int, error) { |
| 714 | var i int |
| 715 | _ = i |
| 716 | var l int |
| 717 | _ = l |
| 718 | if m.Select != nil { |
| 719 | data[i] = 0xa |
| 720 | i++ |
| 721 | i = encodeVarintSql(data, i, uint64(m.Select.Size())) |
| 722 | n1, err := m.Select.MarshalTo(data[i:]) |
| 723 | if err != nil { |
| 724 | return 0, err |
| 725 | } |
| 726 | i += n1 |
| 727 | } |
| 728 | if m.Source != nil { |
| 729 | data[i] = 0x12 |
| 730 | i++ |
| 731 | i = encodeVarintSql(data, i, uint64(m.Source.Size())) |
| 732 | n2, err := m.Source.MarshalTo(data[i:]) |
| 733 | if err != nil { |
| 734 | return 0, err |
| 735 | } |
| 736 | i += n2 |
| 737 | } |
| 738 | if m.Projection != nil { |
| 739 | data[i] = 0x22 |
| 740 | i++ |
| 741 | i = encodeVarintSql(data, i, uint64(m.Projection.Size())) |
| 742 | n3, err := m.Projection.MarshalTo(data[i:]) |
| 743 | if err != nil { |
| 744 | return 0, err |
| 745 | } |
| 746 | i += n3 |
| 747 | } |
| 748 | if m.XXX_unrecognized != nil { |
| 749 | i += copy(data[i:], m.XXX_unrecognized) |
| 750 | } |
| 751 | return i, nil |
| 752 | } |
| 753 | |
| 754 | func (m *SqlSelectPb) Marshal() (data []byte, err error) { |
| 755 | size := m.Size() |
no test coverage detected