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

Function ExampleStrStrMap_LockFunc

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

Source from the content-addressed store, hash-verified

456}
457
458func ExampleStrStrMap_LockFunc() {
459 var m gmap.StrStrMap
460 m.Sets(g.MapStrStr{
461 "k1": "v1",
462 "k2": "v2",
463 "k3": "v3",
464 "k4": "v4",
465 })
466
467 m.LockFunc(func(m map[string]string) {
468 for k, v := range m {
469 fmt.Println("key:", k, " value:", v)
470 }
471 })
472
473 // May Output:
474 // key: k1 value: v1
475 // key: k2 value: v2
476 // key: k3 value: v3
477 // key: k4 value: v4
478}
479
480func ExampleStrStrMap_RLockFunc() {
481 var m gmap.StrStrMap

Callers

nothing calls this directly

Calls 2

SetsMethod · 0.95
LockFuncMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…