MCPcopy
hub / github.com/gogf/gf / ExampleStrIntMap_MarshalJSON

Function ExampleStrIntMap_MarshalJSON

container/gmap/gmap_z_example_str_int_test.go:546–562  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

544}
545
546func ExampleStrIntMap_MarshalJSON() {
547 var m gmap.StrIntMap
548 m.Sets(g.MapStrInt{
549 "k1": 1,
550 "k2": 2,
551 "k3": 3,
552 "k4": 4,
553 })
554
555 bytes, err := json.Marshal(&m)
556 if err == nil {
557 fmt.Println(gconv.String(bytes))
558 }
559
560 // Output:
561 // {"k1":1,"k2":2,"k3":3,"k4":4}
562}
563
564func ExampleStrIntMap_UnmarshalJSON() {
565 var m gmap.StrIntMap

Callers

nothing calls this directly

Calls 3

SetsMethod · 0.95
MarshalFunction · 0.92
StringFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…