The Startup
Published in

The Startup

An Ordered Map in Go

Photo by Jonah Pettrich on Unsplash

An ordered map (also called a linked hash map in Java) is a data structure that allows amortized O(1) for access and mutation just like a map, but the elements maintain their order.

For this I created the github.com/elliotchance/orderedmap package. Here is some basic usage:

m := orderedmap.NewOrderedMap()// Keys and values can be any type.
m.Set("foo", "bar")
m.Set("qux"…

--

--

--

Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +756K followers.

Recommended from Medium

Interesting way to make contribution for not-a-ninja developer

Migrate to GraphQL in 15 minutes with BeamQL ⏩

Part1: Learning Apache Beam Programming in Python

Mistakes I made as a software engineer — Tim Well Said

Basic Spring Security : Spring boot, Spring Security, Web Application

ETL Tools — The ELT vs ETL Process

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Elliot Chance

Elliot Chance

I’m a data nerd and TDD enthusiast originally from Sydney. Currently working for Uber in New York. My thoughts here are my own. 🤓 elliotchance@gmail.com

More from Medium

Robust media upload with Golang and Cloudinary — Gin-gonic Version

Use pprof to view go program stack traces

In-depth analysis of Golang memory escape

Getting started with GO Programming Language — Part Two