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

Function Encode

msgp/write.go:156–164  ·  view source on GitHub ↗

Encode encodes an Encodable to an io.Writer.

(w io.Writer, e Encodable)

Source from the content-addressed store, hash-verified

154
155// Encode encodes an Encodable to an io.Writer.
156func Encode(w io.Writer, e Encodable) error {
157 wr := NewWriter(w)
158 err := e.EncodeMsg(wr)
159 if err == nil {
160 err = wr.Flush()
161 }
162 freeW(wr)
163 return err
164}
165
166func (mw *Writer) flush() error {
167 if mw.wloc == 0 {

Callers 6

encDecCustomTagFunction · 0.92
TestAllownilFunction · 0.92
BenchmarkFastEncodeFunction · 0.92
BenchmarkFastDecodeFunction · 0.92
Test1EncodeDecodeFunction · 0.92
TestIssue168Function · 0.92

Calls 4

FlushMethod · 0.95
NewWriterFunction · 0.85
freeWFunction · 0.85
EncodeMsgMethod · 0.65

Tested by 6

encDecCustomTagFunction · 0.74
TestAllownilFunction · 0.74
BenchmarkFastEncodeFunction · 0.74
BenchmarkFastDecodeFunction · 0.74
Test1EncodeDecodeFunction · 0.74
TestIssue168Function · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…