go-yaml/yaml — pull request #27 by mattes (2014-09-07 13:14:34+00:00)
Title: Allow "ordered" mappings with custom StringIndex type (#22)

Golang doesn't store the order of maps. So in a struct ``map[string]string`` and YAML file like:

```yaml
a: foo
b: bar
```

... there is no garantuee that ``a`` comes before ``b``! Sometimes it might be useful though to know the order. My patch introduces a new type called ``StringIndex``. It stores the index of the elements in maps according to their column, so that multiple ``map[yaml.StringIndex]`` are possible.

At the moment, I can't think of a better way of doing it. Please comment!

See also https://github.com/go-yaml/yaml/issues/22