From f4cc7f1d4c9faaa771a4864e92060cf6417d0ab3 Mon Sep 17 00:00:00 2001 From: Ahrav Dutta Date: Thu, 18 Jan 2024 07:31:20 -0800 Subject: [PATCH] reorg the struct --- .../buffered_file_writer/bufferedfilewriter.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/writers/buffered_file_writer/bufferedfilewriter.go b/pkg/writers/buffered_file_writer/bufferedfilewriter.go index 02c92e8fdd50..0b603cc09cec 100644 --- a/pkg/writers/buffered_file_writer/bufferedfilewriter.go +++ b/pkg/writers/buffered_file_writer/bufferedfilewriter.go @@ -20,11 +20,12 @@ var bufferPool = sync.Pool{ // BufferedFileWriter manages a buffer for writing data, flushing to a file when a threshold is exceeded. type BufferedFileWriter struct { - threshold uint64 // Threshold for switching to file writing. - buf bytes.Buffer // Buffer for storing data under the threshold in memory. - filename string // Name of the temporary file. - file io.WriteCloser // File for storing data over the threshold. - size uint64 // Total size of the data written. + threshold uint64 // Threshold for switching to file writing. + size uint64 // Total size of the data written. + + buf bytes.Buffer // Buffer for storing data under the threshold in memory. + filename string // Name of the temporary file. + file io.WriteCloser // File for storing data over the threshold. } // Option is a function that modifies a BufferedFileWriter.