(data []byte)
| 816 | } |
| 817 | |
| 818 | func (m *NumberNodePb) MarshalTo(data []byte) (int, error) { |
| 819 | var i int |
| 820 | _ = i |
| 821 | var l int |
| 822 | _ = l |
| 823 | data[i] = 0x8 |
| 824 | i++ |
| 825 | if m.Isint { |
| 826 | data[i] = 1 |
| 827 | } else { |
| 828 | data[i] = 0 |
| 829 | } |
| 830 | i++ |
| 831 | data[i] = 0x10 |
| 832 | i++ |
| 833 | if m.Isfloat { |
| 834 | data[i] = 1 |
| 835 | } else { |
| 836 | data[i] = 0 |
| 837 | } |
| 838 | i++ |
| 839 | data[i] = 0x18 |
| 840 | i++ |
| 841 | i = encodeVarintNode(data, i, uint64(m.Iv)) |
| 842 | data[i] = 0x21 |
| 843 | i++ |
| 844 | i = encodeFixed64Node(data, i, uint64(math.Float64bits(float64(m.Fv)))) |
| 845 | data[i] = 0x2a |
| 846 | i++ |
| 847 | i = encodeVarintNode(data, i, uint64(len(m.Text))) |
| 848 | i += copy(data[i:], m.Text) |
| 849 | if m.XXX_unrecognized != nil { |
| 850 | i += copy(data[i:], m.XXX_unrecognized) |
| 851 | } |
| 852 | return i, nil |
| 853 | } |
| 854 | |
| 855 | func (m *ValueNodePb) Marshal() (data []byte, err error) { |
| 856 | size := m.Size() |
no test coverage detected