MCPcopy Create free account
hub / github.com/araddon/qlbridge / MarshalTo

Method MarshalTo

expr/node.pb.go:818–853  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

816}
817
818func (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
855func (m *ValueNodePb) Marshal() (data []byte, err error) {
856 size := m.Size()

Callers 1

MarshalMethod · 0.95

Calls 2

encodeVarintNodeFunction · 0.85
encodeFixed64NodeFunction · 0.85

Tested by

no test coverage detected