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

Method EncodeMsg

msgp/setof/generated.go:2571–2586  ·  view source on GitHub ↗

EncodeMsg encodes the message to the writer.

(writer *msgp.Writer)

Source from the content-addressed store, hash-verified

2569
2570// EncodeMsg encodes the message to the writer.
2571func (s Uint32) EncodeMsg(writer *msgp.Writer) error {
2572 if s == nil {
2573 return writer.WriteNil()
2574 }
2575 err := writer.WriteArrayHeader(uint32(len(s)))
2576 if err != nil {
2577 return err
2578 }
2579 for k := range s {
2580 err = writer.WriteUint32(k)
2581 if err != nil {
2582 return err
2583 }
2584 }
2585 return nil
2586}
2587
2588// MarshalMsg encodes the message to the bytes.
2589func (s Uint32) MarshalMsg(bytes []byte) ([]byte, error) {

Callers 1

TestUint32_NilHandlingFunction · 0.95

Calls 3

WriteNilMethod · 0.80
WriteArrayHeaderMethod · 0.80
WriteUint32Method · 0.80

Tested by 1

TestUint32_NilHandlingFunction · 0.76