Skip to content
O

Orderedmap

An ordered map in Go with amortized O(1) for Set, Get, Delete and Len

by elliotchanceFree

#2298in Utilities
0In stores

Description

orderedmap is a Go package that provides a map which remembers insertion order while keeping amortized O(1) time for Set, Get, Delete and Le…

Highlights

  • Insertion-ordered map with amortized O(1) Set, Get, Delete and Len
  • Iterators from front or back, over keys or values
  • Works with slices.Collect and maps.Collect
  • Versions for Go 1.23+, 1.18 to 1.22, and older

Ratings & Reviews

No ratings yet

Be the first to rate Orderedmap.

People also visit

G

golang-data-structures

Golang data structures

AI Skills
Get
G

golang-samber-lo

Functional programming helpers for Golang using samber/lo

AI Skills
Get
M

modern-go-guidelines

Enhances Claude Code with modern Go guidelines up to go 1.26 version

AI Skills
Get
G

golang-modernize

Modernize Golang code to use recent language features

AI Skills
Get
G

golang-samber-ro

Reactive streams and event-driven programming in Golang using samber/ro

AI Skills
Get
G

go-packages

Creating Go packages, organizing imports, managing dependencies

AI Skills
Get

Orderedmap FAQ

What does orderedmap provide?

An ordered map for Go that keeps insertion order with amortized O(1) Set, Get, Delete and Len.

Which Go version do I need?

v3 requires Go 1.23. Use v2 for Go 1.18 to 1.22, and v1 for Go 1.17 or below.

How do I iterate?

Use AllFromFront(), AllFromBack(), Keys() or Values(), or loop manually with Front() or Back() and Next().

Is it safe to modify the map while iterating?

The README warns that changing the map during iteration may produce unexpected behavior.

What are the best Orderedmap alternatives?

Popular alternatives to Orderedmap include DataViz, Go Git and OsmAPP. See all Orderedmap alternatives

Developer Stuff

Badges