jpedro / dict

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dict

Go's map internal type is by design not ordered.

So this new struct Dict fixes that, by iterating over the items in the same order as they were created.

The name comes from in human dictionaries entries are ordered.

Usage

d := dict.New()
d.Set("key", "val")
v := d.Get("key")
if v != "val" {
    panic("The value is wrong.")
}

About


Languages

Language:Go 96.2%Language:Makefile 3.8%