Documentation
¶
Overview ¶
Package jsonutils provides essential JSON utilities. Making JSON less painful, one function at a time
Index ¶
- func Decode(reader io.Reader, v interface{}) error
- func Encode(writer io.Writer, v interface{}) error
- func FromJSON(jsonStr string, v interface{}) error
- func FromJSONFile(filename string, v interface{}) error
- func IsValidJSON(jsonStr string) bool
- func ToJSON(v interface{}) (string, error)
- func ToJSONFile(filename string, v interface{}) error
- func ToPrettyJSON(v interface{}) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromJSONFile ¶
FromJSONFile reads JSON file into provided value.
func IsValidJSON ¶
IsValidJSON checks if string is valid JSON. Spoiler alert: most strings are not
func ToJSONFile ¶
ToJSONFile writes value to JSON file.
func ToPrettyJSON ¶
ToPrettyJSON converts any value to formatted JSON.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.