MCPcopy Index your code
hub / github.com/vmihailenco/msgpack / Marshal

Function Marshal

encode.go:60–75  ·  view source on GitHub ↗

Marshal returns the MessagePack encoding of v.

(v interface{})

Source from the content-addressed store, hash-verified

58
59// Marshal returns the MessagePack encoding of v.
60func Marshal(v interface{}) ([]byte, error) {
61 enc := GetEncoder()
62
63 var buf bytes.Buffer
64 enc.Reset(&buf)
65
66 err := enc.Encode(v)
67 b := buf.Bytes()
68
69 PutEncoder(enc)
70
71 if err != nil {
72 return nil, err
73 }
74 return b, err
75}
76
77type Encoder struct {
78 w writer

Callers

nothing calls this directly

Calls 4

GetEncoderFunction · 0.85
PutEncoderFunction · 0.85
EncodeMethod · 0.80
ResetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…