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

Function ExampleStrStrMap_Iterator

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

Source from the content-addressed store, hash-verified

16)
17
18func ExampleStrStrMap_Iterator() {
19 m := gmap.NewStrStrMap()
20 for i := 0; i < 10; i++ {
21 m.Set("key"+gconv.String(i), "var"+gconv.String(i))
22 }
23
24 var str string
25 m.Iterator(func(k string, v string) bool {
26
27 str += v + "|"
28
29 return len(str) < 20
30 })
31
32 fmt.Println("str:", str)
33
34 // May Output:
35 // var0|var1|var2|var3|
36}
37
38func ExampleStrStrMap_Clone() {
39 m := gmap.NewStrStrMap()

Callers

nothing calls this directly

Calls 4

SetMethod · 0.95
IteratorMethod · 0.95
NewStrStrMapFunction · 0.92
StringFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…