mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 13:48:06 +00:00
cf8cfbd865
* Refactor ordered_map into separate files Separate json and xml, from the regular yaml. Makes it possible to compile, without those... * Refactor encoder and decoder creation Use more consistent parameters vs globals Return errors instead of calling panic() * Allow build without json and xml support
15 lines
343 B
Go
15 lines
343 B
Go
package yqlib
|
|
|
|
// orderedMap allows to marshal and unmarshal JSON and YAML values keeping the
|
|
// order of keys and values in a map or an object.
|
|
type orderedMap struct {
|
|
// if this is an object, kv != nil. If this is not an object, kv == nil.
|
|
kv []orderedMapKV
|
|
altVal interface{}
|
|
}
|
|
|
|
type orderedMapKV struct {
|
|
K string
|
|
V orderedMap
|
|
}
|