Skip to content

Commit

Permalink
add Flush() method
Browse files Browse the repository at this point in the history
  • Loading branch information
stokito committed Feb 21, 2023
1 parent 4c8f03c commit bf3a786
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gzip_buf_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,13 @@ func (f *GzBufFile) WriteTwoLines(line1 []byte, line2 []byte) error {
}

func (f *GzBufFile) Close() error {
_ = f.bufWriter.Flush()
_ = f.gzipWriter.Flush()
_ = f.Flush()
// Close the gzip first.
_ = f.gzipWriter.Close()
return f.outputFile.Close()
}

func (f *GzBufFile) Flush() error {
_ = f.bufWriter.Flush()
return f.gzipWriter.Flush()
}

0 comments on commit bf3a786

Please sign in to comment.