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

Function ExampleListMap_MarshalJSON

container/gmap/gmap_z_example_list_test.go:564–578  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

562}
563
564func ExampleListMap_MarshalJSON() {
565 var m gmap.ListMap
566 m.Set("k1", "v1")
567 m.Set("k2", "v2")
568 m.Set("k3", "v3")
569 m.Set("k4", "v4")
570
571 bytes, err := json.Marshal(&m)
572 if err == nil {
573 fmt.Println(gconv.String(bytes))
574 }
575
576 // Output:
577 // {"k1":"v1","k2":"v2","k3":"v3","k4":"v4"}
578}
579
580func ExampleListMap_UnmarshalJSON() {
581 var m gmap.ListMap

Callers

nothing calls this directly

Calls 3

SetMethod · 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…