diff --git a/helper/report.go b/helper/report.go index db1ed7f..aeee458 100644 --- a/helper/report.go +++ b/helper/report.go @@ -114,12 +114,10 @@ func (r *Report) WriteToFile(fileName string) error { return err } - defer file.Close() - err = r.WriteToWriter(file) if err != nil { return err } - return file.Sync() + return file.Close() }