util/misc.go
func WriteJSONFile(name, prefix, indent string, data interface{}) error {
	file, err := os.Create(name)
	if err != nil {
		return err
	}
	defer file.Close()

	enc := json.NewEncoder(file)
	enc.SetIndent(prefix, indent)
	return enc.Encode(data)
}
func WriteJSONFile(name, prefix, indent string, data interface{}) error {
	file, err := os.Create(name)
	if err != nil {
		return err
	}
	defer file.Close()

	enc := json.NewEncoder(file)
	enc.SetIndent(prefix, indent)
	return enc.Encode(data)
}
func WriteJSONFile ( name , prefix , indent string , data interface { } ) error { file , err := os . Create ( name ) if err != nil { return err } defer file . Close ( ) enc := json . NewEncoder ( file ) enc . SetIndent ( prefix , indent ) return enc . Encode ( data ) }
// WriteJSONFile converts a given data instance to JSON and writes it to file.
WriteJSONFile converts a given data instance to JSON and writes it to file .