()
| 16 | ) |
| 17 | |
| 18 | func ExampleStrIntMap_Iterator() { |
| 19 | m := gmap.NewStrIntMap() |
| 20 | for i := 0; i < 10; i++ { |
| 21 | m.Set(gconv.String(i), i*2) |
| 22 | } |
| 23 | |
| 24 | var totalValue int |
| 25 | m.Iterator(func(k string, v int) bool { |
| 26 | totalValue += v |
| 27 | |
| 28 | return totalValue < 50 |
| 29 | }) |
| 30 | |
| 31 | fmt.Println("totalValue:", totalValue) |
| 32 | |
| 33 | // May Output: |
| 34 | // totalValue: 52 |
| 35 | } |
| 36 | |
| 37 | func ExampleStrIntMap_Clone() { |
| 38 | m := gmap.NewStrIntMap() |
nothing calls this directly
no test coverage detected
searching dependent graphs…