MCPcopy Index your code
hub / github.com/aceld/zinx / MarshalJSON

Method MarshalJSON

zutils/shard_lock_map.go:441–448  ·  view source on GitHub ↗

MarshalJSON Reviles ConcurrentMap "private" variables to json marshal.

()

Source from the content-addressed store, hash-verified

439
440// MarshalJSON Reviles ConcurrentMap "private" variables to json marshal.
441func (slm ShardLockMaps) MarshalJSON() ([]byte, error) {
442 tmp := make(map[string]interface{})
443
444 for item := range slm.IterBuffered() {
445 tmp[item.Key] = item.Val
446 }
447 return json.Marshal(tmp)
448}
449
450// UnmarshalJSON Reverse process of Marshal.
451func (slm ShardLockMaps) UnmarshalJSON(b []byte) (err error) {

Callers 2

BenchmarkMarshalJsonFunction · 0.95
TestJsonMarshalFunction · 0.80

Calls 1

IterBufferedMethod · 0.95

Tested by 2

BenchmarkMarshalJsonFunction · 0.76
TestJsonMarshalFunction · 0.64