()
| 544 | } |
| 545 | |
| 546 | func 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 | |
| 564 | func ExampleStrIntMap_UnmarshalJSON() { |
| 565 | var m gmap.StrIntMap |