MCPcopy Create free account
hub / github.com/chain/txvm / MarshalJSON

Method MarshalJSON

encoding/json/json.go:34–39  ·  view source on GitHub ↗

MarshalJSON satisfies the json.Marshaler interface.

()

Source from the content-addressed store, hash-verified

32
33// MarshalJSON satisfies the json.Marshaler interface.
34func (m Map) MarshalJSON() ([]byte, error) {
35 if len(m) == 0 {
36 return []byte("{}"), nil
37 }
38 return m, nil
39}
40
41// UnmarshalJSON satisfies the json.Unmarshaler interface.
42func (m *Map) UnmarshalJSON(text []byte) error {

Callers 2

mainFunction · 0.95
TestMarshalJSONMapFunction · 0.45

Calls

no outgoing calls

Tested by 1

TestMarshalJSONMapFunction · 0.36