MCPcopy
hub / github.com/duke-git/lancet / ExampleOrderedMap_Set

Function ExampleOrderedMap_Set

maputil/map_example_test.go:562–578  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

560}
561
562func ExampleOrderedMap_Set() {
563 om := NewOrderedMap[string, int]()
564
565 om.Set("a", 1)
566 om.Set("b", 2)
567 om.Set("c", 3)
568
569 val1, ok := om.Get("a")
570 fmt.Println(val1, ok)
571
572 val2, ok := om.Get("d")
573 fmt.Println(val2, ok)
574
575 // Output:
576 // 1 true
577 // 0 false
578}
579
580func ExampleOrderedMap_Get() {
581 om := NewOrderedMap[string, int]()

Callers

nothing calls this directly

Calls 3

NewOrderedMapFunction · 0.85
SetMethod · 0.65
GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…