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

Method MarshalTo

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

Source from the content-addressed store, hash-verified

473}
474
475func (m *BinaryNodePb) MarshalTo(data []byte) (int, error) {
476 var i int
477 _ = i
478 var l int
479 _ = l
480 data[i] = 0x8
481 i++
482 i = encodeVarintNode(data, i, uint64(m.Op))
483 data[i] = 0x10
484 i++
485 if m.Paren {
486 data[i] = 1
487 } else {
488 data[i] = 0
489 }
490 i++
491 if len(m.Args) > 0 {
492 for _, msg := range m.Args {
493 data[i] = 0x1a
494 i++
495 i = encodeVarintNode(data, i, uint64(msg.Size()))
496 n, err := msg.MarshalTo(data[i:])
497 if err != nil {
498 return 0, err
499 }
500 i += n
501 }
502 }
503 if m.XXX_unrecognized != nil {
504 i += copy(data[i:], m.XXX_unrecognized)
505 }
506 return i, nil
507}
508
509func (m *BooleanNodePb) Marshal() (data []byte, err error) {
510 size := m.Size()

Callers 1

MarshalMethod · 0.95

Calls 3

encodeVarintNodeFunction · 0.85
SizeMethod · 0.45
MarshalToMethod · 0.45

Tested by

no test coverage detected