Documentation
¶
Overview ¶
Package jsonutil provides utility functions for working with JSON files, including secure file loading and pretty-printing of JSON data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadFile ¶
LoadFile reads a JSON file at the given path into a typed object.
Parameters:
- path: the file path to read
Returns:
- *T: pointer to the decoded object
- error: if the file cannot be read or decoded
func PrettyJSON ¶
PrettyJSON returns a pretty-printed JSON string representation of the given object.
Parameters:
- object: the value to marshal as JSON
Returns:
- string: the pretty-printed JSON
- error: if marshaling fails
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.