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

Function ExampleStrStrMap_Pops

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

Source from the content-addressed store, hash-verified

192}
193
194func ExampleStrStrMap_Pops() {
195 var m gmap.StrStrMap
196 m.Sets(g.MapStrStr{
197 "k1": "v1",
198 "k2": "v2",
199 "k3": "v3",
200 "k4": "v4",
201 })
202 fmt.Println(m.Pops(-1))
203 fmt.Println("size:", m.Size())
204
205 m.Sets(g.MapStrStr{
206 "k1": "v1",
207 "k2": "v2",
208 "k3": "v3",
209 "k4": "v4",
210 })
211 fmt.Println(m.Pops(2))
212 fmt.Println("size:", m.Size())
213
214 // May Output:
215 // map[k1:v1 k2:v2 k3:v3 k4:v4]
216 // size: 0
217 // map[k1:v1 k2:v2]
218 // size: 2
219}
220
221func ExampleStrStrMap_GetOrSet() {
222 m := gmap.NewStrStrMap()

Callers

nothing calls this directly

Calls 3

SetsMethod · 0.95
PopsMethod · 0.95
SizeMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…