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

Function ExampleStrStrMap_Replace

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

Source from the content-addressed store, hash-verified

431}
432
433func ExampleStrStrMap_Replace() {
434 var m gmap.StrStrMap
435 m.Sets(g.MapStrStr{
436 "k1": "v1",
437 })
438
439 var n gmap.StrStrMap
440 n.Sets(g.MapStrStr{
441 "k2": "v2",
442 })
443
444 fmt.Println(m.Map())
445
446 m.Replace(n.Map())
447 fmt.Println(m.Map())
448
449 n.Set("k2", "v1")
450 fmt.Println(m.Map())
451
452 // Output:
453 // map[k1:v1]
454 // map[k2:v2]
455 // map[k2:v1]
456}
457
458func ExampleStrStrMap_LockFunc() {
459 var m gmap.StrStrMap

Callers

nothing calls this directly

Calls 4

SetsMethod · 0.95
MapMethod · 0.95
ReplaceMethod · 0.95
SetMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…