mirror of
https://github.com/johnkerl/miller.git
synced 2026-08-04 13:33:18 +00:00
| .. | ||
| ordered.go | ||
| ordered_test.go | ||
| README.md | ||
JSON object parsing with preserving keys order
Refers
- JSON and Go https://blog.golang.org/json-and-go
- Go-Ordered-JSON https://github.com/virtuald/go-ordered-json from this thread Preserving key order in encoding/json and the Abandoned 7930: encoding/json: Optionally preserve the key order of JSON objects
- Python OrderedDict https://github.com/python/cpython/blob/2.7/Lib/collections.py#L38
the Python's OrderedDict uses a double linked list internally, maintain a consistent public interface with
dict
Disclaimer:
same as Go's default map, this OrderedMap is not safe for concurrent use, if need atomic access, may use a sync.Mutex to synchronize.