Documentation
¶
Overview ¶
Package ordered gives the dynamic JSON members of a decoded Go value the key order of their JSON text.
Pi decodes a stored record with JSON.parse, so an object inside a dynamic member (a JsonValue such as a task's checkpoint or an entry's data) keeps the key order of the text. encoding/json decodes such a member into a Go map, which has no order. Restore replaces each dynamic member with the same text decoded into insertion-ordered objects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasDynamic ¶
HasDynamic reports whether a value of type t can hold a dynamic JSON member that Restore would replace.
func Restore ¶
Restore replaces every dynamic member of *target (a member whose static type is an empty interface) with the value at the same position in tree, the JSON text *target was decoded from, decoded with insertion-ordered objects (delta.DecodeJson). target must be a non-nil pointer. Members that decode themselves (json.Unmarshaler or encoding.TextUnmarshaler) keep their value. tree's values become part of *target, so the caller must not share tree.
Types ¶
This section is empty.