MCPcopy
hub / github.com/name5566/leaf / ExampleMap

Function ExampleMap

util/example_test.go:8–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6)
7
8func ExampleMap() {
9 m := new(util.Map)
10
11 fmt.Println(m.Get("key"))
12 m.Set("key", "value")
13 fmt.Println(m.Get("key"))
14 m.Del("key")
15 fmt.Println(m.Get("key"))
16
17 m.Set(1, "1")
18 m.Set(2, 2)
19 m.Set("3", 3)
20
21 fmt.Println(m.Len())
22
23 // Output:
24 // <nil>
25 // value
26 // <nil>
27 // 3
28}
29
30func ExampleRandGroup() {
31 i := util.RandGroup(0, 0, 50, 50)

Callers

nothing calls this directly

Calls 4

GetMethod · 0.80
SetMethod · 0.80
DelMethod · 0.80
LenMethod · 0.45

Tested by

no test coverage detected