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

Function ExampleIntIntMap_MarshalJSON

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

Source from the content-addressed store, hash-verified

539}
540
541func ExampleIntIntMap_MarshalJSON() {
542 var m gmap.IntIntMap
543 m.Sets(g.MapIntInt{
544 1: 1,
545 2: 2,
546 3: 3,
547 4: 4,
548 })
549
550 bytes, err := json.Marshal(&m)
551 if err == nil {
552 fmt.Println(gconv.String(bytes))
553 }
554
555 // Output:
556 // {"1":1,"2":2,"3":3,"4":4}
557}
558
559func ExampleIntIntMap_UnmarshalJSON() {
560 var m gmap.IntIntMap

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…