lxd-benchmark/benchmark/report.go
func (r *CSVReport) Write() error {
	file, err := os.OpenFile(r.Filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0640)
	if err != nil {
		return err
	}
	defer file.Close()

	writer := csv.NewWriter(file)
	err = writer.WriteAll(r.records)
	if err != nil {
		return err
	}

	logf("Written report file %s", r.Filename)
	return nil
}
func (r *CSVReport) Write() error {
	file, err := os.OpenFile(r.Filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0640)
	if err != nil {
		return err
	}
	defer file.Close()

	writer := csv.NewWriter(file)
	err = writer.WriteAll(r.records)
	if err != nil {
		return err
	}

	logf("Written report file %s", r.Filename)
	return nil
}
func ( r * CSVReport ) Write ( ) error { file , err := os . OpenFile ( r . Filename , os . O_WRONLY | os . O_CREATE | os . O_TRUNC , 0640 ) if err != nil { return err } defer file . Close ( ) writer := csv . NewWriter ( file ) err = writer . WriteAll ( r . records ) if err != nil { return err } logf ( " " , r . Filename ) return nil }
// Write writes current records to file.
Write writes current records to file .