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

Function ExampleStrStrMap_MarshalJSON

container/gmap/gmap_z_example_str_str_test.go:541–557  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

539}
540
541func ExampleStrStrMap_MarshalJSON() {
542 var m gmap.StrStrMap
543 m.Sets(g.MapStrStr{
544 "k1": "v1",
545 "k2": "v2",
546 "k3": "v3",
547 "k4": "v4",
548 })
549
550 bytes, err := json.Marshal(&m)
551 if err == nil {
552 fmt.Println(gconv.String(bytes))
553 }
554
555 // Output:
556 // {"k1":"v1","k2":"v2","k3":"v3","k4":"v4"}
557}
558
559func ExampleStrStrMap_UnmarshalJSON() {
560 var m gmap.StrStrMap

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…