Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalAndSortJSON ¶
MarshalAndSortJSON sorts alphabetically the json representation of an interface and returns its marshaled value.
func MustMarshalAndSortJSON ¶
func MustMarshalAndSortJSON(jsonValue interface{}) []byte
MustMarshalAndSortJSON panics if MarshalAndSortJSON fails.
Types ¶
type MarshalWrapper ¶
type MarshalWrapper struct { Value interface{} `json:"value"` Type string `json:"type"` }
MarshalWrapper wraps an interface value and its corresponding string type. It is useful to convert an interface field to unmarshal it back afterwards.
type UnmarshalWrapper ¶
type UnmarshalWrapper struct { Value json.RawMessage `json:"value"` Type string `json:"type"` }
UnmarshalWrapper wraps a json raw message and its corresponding string type. It is useful to delay the unmarshal step once a concrete type can be determined by its string type.
Click to show internal directories.
Click to hide internal directories.