Documentation ¶
Overview ¶
Package encoding provides encoding utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetJSONStringOrStringValue ¶
func GetJSONStringOrStringValue(rawMessage json.RawMessage) string
GetJSONStringOrStringValue returns the JSON string for the RawMessage if the RawMessage is a string, and the raw value as a string otherwise.
If the RawMessage is empty, this returns "".
func UnmarshalJSONOrYAMLStrict ¶
UnmarshalJSONOrYAMLStrict unmarshals the data as JSON or YAML in order, returning a user error with both errors on failure.
If the data length is 0, this is a no-op.
func UnmarshalJSONStrict ¶
UnmarshalJSONStrict unmarshals the data as JSON, returning a user error on failure.
If the data length is 0, this is a no-op.
func UnmarshalYAMLStrict ¶
UnmarshalYAMLStrict unmarshals the data as YAML, returning a user error on failure.
If the data length is 0, this is a no-op.
Types ¶
This section is empty.