Documentation
¶
Index ¶
- Variables
- func BestEffortMinifyJSON(jsonStr string) string
- func BestEffortMinifyMarshal(v interface{}) string
- func BestEffortPrettyJSON(jsonStr string) string
- func BestEffortPrettyMarshal(v interface{}) string
- func PrettyJSON(jsonStr string) (string, error)
- func PrettyMarshal(v interface{}) (string, error)
Constants ¶
This section is empty.
Variables ¶
var BMJ = BestEffortMinifyJSON
BMJ is a shortcut to BestEffortMinifyJSON
var BMM = BestEffortMinifyMarshal
BMM is a shortcut to BestEffortMinifyMarshal
var BPJ = BestEffortPrettyJSON
BPJ is a shortcut (mostly used in tests) to BestEffortPrettyJSON.
var BPM = BestEffortPrettyMarshal
BPM is a shortcut (mostly used in tests) to BestEffortPrettyMarshal.
Functions ¶
func BestEffortMinifyJSON ¶ added in v0.0.12
BestEffortMinifyJSON reformats a json string to be minimal, ignoring any error.
func BestEffortMinifyMarshal ¶ added in v0.0.12
func BestEffortMinifyMarshal(v interface{}) string
BestEffortMinifyMarshal returns a mninified JSON encoding of v. Any error countered will cause "{}" be returned.
func BestEffortPrettyJSON ¶
BestEffortPrettyJSON reformats a json string to be pretty, ignoring any error.
func BestEffortPrettyMarshal ¶
func BestEffortPrettyMarshal(v interface{}) string
BestEffortPrettyMarshal does a best effort JSON marshaling of 'v' with human readable output. '{}' will be produced if there is any JSON marshal error. This function never fails.
func PrettyJSON ¶
PrettyJSON reformats a json string to be pretty
func PrettyMarshal ¶
PrettyMarshal does a JSON marshaling of 'v' with human readable output.
Types ¶
This section is empty.