From 06a73adb1efed60277f8af305d4de72bf4743e79 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Fri, 6 Jan 2017 11:40:35 +0100 Subject: [PATCH] return error in SetBuffered --- common/bufio/writer.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/bufio/writer.go b/common/bufio/writer.go index 42bf563cf..d1af58865 100644 --- a/common/bufio/writer.go +++ b/common/bufio/writer.go @@ -84,9 +84,10 @@ func (v *BufferedWriter) IsBuffered() bool { } // SetBuffered controls whether the BufferedWriter holds a buffer for writing. If not buffered, any write() calls into underlying writer directly. -func (v *BufferedWriter) SetBuffered(cached bool) { +func (v *BufferedWriter) SetBuffered(cached bool) error { v.buffered = cached if !cached && !v.buffer.IsEmpty() { - v.Flush() + return v.Flush() } + return nil }