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

Method EncodeMsg

msgp/setof/generated.go:291–306  ·  view source on GitHub ↗

EncodeMsg encodes the message to the writer.

(writer *msgp.Writer)

Source from the content-addressed store, hash-verified

289
290// EncodeMsg encodes the message to the writer.
291func (s Int) EncodeMsg(writer *msgp.Writer) error {
292 if s == nil {
293 return writer.WriteNil()
294 }
295 err := writer.WriteArrayHeader(uint32(len(s)))
296 if err != nil {
297 return err
298 }
299 for k := range s {
300 err = writer.WriteInt(k)
301 if err != nil {
302 return err
303 }
304 }
305 return nil
306}
307
308// MarshalMsg encodes the message to the bytes.
309func (s Int) MarshalMsg(bytes []byte) ([]byte, error) {

Callers 1

TestInt_NilHandlingFunction · 0.95

Calls 3

WriteNilMethod · 0.80
WriteArrayHeaderMethod · 0.80
WriteIntMethod · 0.80

Tested by 1

TestInt_NilHandlingFunction · 0.76