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

Function mustEncodeToJSON

_generated/omitempty_test.go:12–30  ·  view source on GitHub ↗
(o msgp.Encodable)

Source from the content-addressed store, hash-verified

10)
11
12func mustEncodeToJSON(o msgp.Encodable) string {
13 var buf bytes.Buffer
14 var err error
15
16 en := msgp.NewWriter(&buf)
17 err = o.EncodeMsg(en)
18 if err != nil {
19 panic(err)
20 }
21 en.Flush()
22
23 var outbuf bytes.Buffer
24 _, err = msgp.CopyToJSON(&outbuf, &buf)
25 if err != nil {
26 panic(err)
27 }
28
29 return outbuf.String()
30}
31
32func TestOmitEmpty0(t *testing.T) {
33 var s string

Callers 4

TestOmitEmpty0Function · 0.85
TestOmitEmptyNoNamesFunction · 0.85
TestOmitEmptyHalfFullFunction · 0.85
TestOmitEmptyLotsOFieldsFunction · 0.85

Calls 5

FlushMethod · 0.95
NewWriterFunction · 0.92
CopyToJSONFunction · 0.92
EncodeMsgMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…