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

Method EncodeMsg

msgp/setof/generated.go:1431–1446  ·  view source on GitHub ↗

EncodeMsg encodes the message to the writer.

(writer *msgp.Writer)

Source from the content-addressed store, hash-verified

1429
1430// EncodeMsg encodes the message to the writer.
1431func (s Uint8) EncodeMsg(writer *msgp.Writer) error {
1432 if s == nil {
1433 return writer.WriteNil()
1434 }
1435 err := writer.WriteArrayHeader(uint32(len(s)))
1436 if err != nil {
1437 return err
1438 }
1439 for k := range s {
1440 err = writer.WriteUint8(k)
1441 if err != nil {
1442 return err
1443 }
1444 }
1445 return nil
1446}
1447
1448// MarshalMsg encodes the message to the bytes.
1449func (s Uint8) MarshalMsg(bytes []byte) ([]byte, error) {

Callers 1

TestUint8_NilHandlingFunction · 0.95

Calls 3

WriteNilMethod · 0.80
WriteArrayHeaderMethod · 0.80
WriteUint8Method · 0.80

Tested by 1

TestUint8_NilHandlingFunction · 0.76