Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

Notifications You must be signed in to change notification settings

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]any 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

AltStyle によって変換されたページ (->オリジナル) /