### Manual Iteration of OrderedMap in Go Source: https://github.com/elliotchance/orderedmap/blob/master/README.md Provides examples of manually iterating through an ordered map using the Front(), Next(), Back(), and Prev() methods. This allows for bidirectional traversal of the map's elements. ```Go // Iterate through all elements from oldest to newest: for el := m.Front(); el != nil; el = el.Next() { fmt.Println(el.Key, el.Value) } ``` ```Go // You can also use Back and Prev to iterate in reverse: for el := m.Back(); el != nil; el = el.Prev() { fmt.Println(el.Key, el.Value) } ``` -------------------------------- ### Basic Usage of OrderedMap in Go Source: https://github.com/elliotchance/orderedmap/blob/master/README.md Demonstrates how to create, set, and delete elements in an ordered map using the orderedmap/v3 package. It shows the basic API for managing key-value pairs while maintaining insertion order. ```Go import "github.com/elliotchance/orderedmap/v3" func main() { m := orderedmap.NewOrderedMap[string, any]() m.Set("foo", "bar") m.Set("qux", 1.23) m.Set("123", true) m.Delete("qux") } ``` -------------------------------- ### Iterating through OrderedMap Elements in Go Source: https://github.com/elliotchance/orderedmap/blob/master/README.md Illustrates how to iterate over elements in an ordered map from front to back using the AllFromFront() iterator. It also shows how to collect keys and values into slices using slices.Collect. ```Go // Iterate through all elements from oldest to newest: for key, value := range m.AllFromFront() { fmt.Println(key, value) } ``` ```Go fmt.Println(slices.Collect(m.Keys())) // [A B C] ``` ```Go fmt.Println(maps.Collect(m.AllFromFront())) // [A:1 B:2 C:3] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.