MCPcopy
hub / github.com/CodisLabs/codis / jsonEncode

Function jsonEncode

pkg/models/encode.go:13–19  ·  view source on GitHub ↗
(v interface{})

Source from the content-addressed store, hash-verified

11)
12
13func jsonEncode(v interface{}) []byte {
14 b, err := json.MarshalIndent(v, "", " ")
15 if err != nil {
16 log.PanicErrorf(err, "encode to json failed")
17 }
18 return b
19}
20
21func jsonDecode(v interface{}, b []byte) error {
22 if err := json.Unmarshal(b, v); err != nil {

Callers 5

EncodeMethod · 0.85
EncodeMethod · 0.85
EncodeMethod · 0.85
EncodeMethod · 0.85
EncodeMethod · 0.85

Calls 1

PanicErrorfMethod · 0.80

Tested by

no test coverage detected