diff --git a/cwriter/writer.go b/cwriter/writer.go index 2ffc6c6..44ff736 100644 --- a/cwriter/writer.go +++ b/cwriter/writer.go @@ -36,7 +36,9 @@ // Flush flushes the underlying buffer func (w *Writer) Flush(lineCount int) (err error) { - w.clearLines() + if w.lineCount > 0 { + w.clearLines() + } w.lineCount = lineCount _, err = w.buf.WriteTo(w.out) return