8000 GitHub - cornelk/orderedmap: A Golang Map that keeps track of the insert order of items.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cornelk/orderedmap

Repository files navigation

orderedmap

Build status go.dev reference Go Report Card codecov

Overview

A Golang Map that keeps track of the insert order of items.

The current version can be used as a replacement for map[string]interface{} and allows JSON unmarshalling into it. No manual adding of items is currently possible.

Usage

Unmarshall and marshall JSON:

var m Map
input := `{"423":"abc","231":"dbh","152":"xyz"}`

m.UnmarshalJSON([]byte(input))

output, _ := m.MarshalJSON()
# unlike the standard Golang map, the output will be exact the same and not in random key order

About

A Golang Map that keeps track of the insert order of items.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0