MCPcopy
hub / github.com/tinylib/msgp / EncodeMsg

Method EncodeMsg

msgp/setof/generated.go:576–591  ·  view source on GitHub ↗

EncodeMsg encodes the message to the writer.

(writer *msgp.Writer)

Source from the content-addressed store, hash-verified

574
575// EncodeMsg encodes the message to the writer.
576func (s Uint) EncodeMsg(writer *msgp.Writer) error {
577 if s == nil {
578 return writer.WriteNil()
579 }
580 err := writer.WriteArrayHeader(uint32(len(s)))
581 if err != nil {
582 return err
583 }
584 for k := range s {
585 err = writer.WriteUint(k)
586 if err != nil {
587 return err
588 }
589 }
590 return nil
591}
592
593// MarshalMsg encodes the message to the bytes.
594func (s Uint) MarshalMsg(bytes []byte) ([]byte, error) {

Callers 1

TestUint_NilHandlingFunction · 0.95

Calls 3

WriteNilMethod · 0.80
WriteArrayHeaderMethod · 0.80
WriteUintMethod · 0.80

Tested by 1

TestUint_NilHandlingFunction · 0.76