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

Method EncodeMsg

msgp/read_bytes.go:99–105  ·  view source on GitHub ↗

EncodeMsg implements [Encodable]. It writes the raw bytes to the writer. If r is empty, it writes 'nil' instead.

(w *Writer)

Source from the content-addressed store, hash-verified

97// It writes the raw bytes to the writer.
98// If r is empty, it writes 'nil' instead.
99func (r Raw) EncodeMsg(w *Writer) error {
100 if len(r) == 0 {
101 return w.WriteNil()
102 }
103 _, err := w.Write([]byte(r))
104 return err
105}
106
107// DecodeMsg implements [Decodable].
108// It sets the value of *Raw to be the

Callers 2

TestRawFunction · 0.95
TestNullRawFunction · 0.95

Calls 2

WriteNilMethod · 0.80
WriteMethod · 0.45

Tested by 2

TestRawFunction · 0.76
TestNullRawFunction · 0.76