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

Function ExampleOrderedMap_Range

maputil/map_example_test.go:723–739  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

721}
722
723func ExampleOrderedMap_Range() {
724 om := NewOrderedMap[string, int]()
725
726 om.Set("a", 1)
727 om.Set("b", 2)
728 om.Set("c", 3)
729
730 om.Range(func(key string, value int) bool {
731 fmt.Println(key, value)
732 return true
733 })
734
735 // Output:
736 // a 1
737 // b 2
738 // c 3
739}
740
741func ExampleOrderedMap_Elements() {
742 om := NewOrderedMap[string, int]()

Callers

nothing calls this directly

Calls 3

NewOrderedMapFunction · 0.85
SetMethod · 0.65
RangeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…