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

Function ExampleIntAnyMap_MarshalJSON

container/gmap/gmap_z_example_int_any_test.go:613–629  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

611}
612
613func ExampleIntAnyMap_MarshalJSON() {
614 var m gmap.IntAnyMap
615 m.Sets(g.MapIntAny{
616 1: "v1",
617 2: "v2",
618 3: "v3",
619 4: "v4",
620 })
621
622 bytes, err := json.Marshal(&m)
623 if err == nil {
624 fmt.Println(gconv.String(bytes))
625 }
626
627 // Output:
628 // {"1":"v1","2":"v2","3":"v3","4":"v4"}
629}
630
631func ExampleIntAnyMap_UnmarshalJSON() {
632 var m gmap.IntAnyMap

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…