Documentation ¶
Index ¶
- func LoadObjectFromFile(filename string, object interface{}) (err error)
- func NewFormattedJSONEncoder(w io.Writer) *json.Encoder
- func SaveNonDefaultValuesToFile(filename string, object, defaultObject interface{}, ignore []string, ...) error
- func SaveObjectToFile(filename string, object interface{}, prettyFormat bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadObjectFromFile ¶
LoadObjectFromFile implements the common pattern for loading an instance of an object from a json file.
func NewFormattedJSONEncoder ¶
NewFormattedJSONEncoder returns a json encoder configured for pretty-printed output (human-readable)
func SaveNonDefaultValuesToFile ¶
func SaveNonDefaultValuesToFile(filename string, object, defaultObject interface{}, ignore []string, prettyFormat bool) error
SaveNonDefaultValuesToFile saves an object to a file as json, but only fields that are not currently set to be the default value. Optionally, you can specify an array of field names to always include.
func SaveObjectToFile ¶
SaveObjectToFile implements the common pattern for saving an object to a file as json
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.