From ec8f8d4e10d4f942cfd8f4a21255f1eb2359534f Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Mon, 20 Nov 2017 11:13:27 +0100 Subject: [PATCH] remove check for ReaderFrom on underlying writer, as it may be badly implemented. --- common/buf/writer.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/common/buf/writer.go b/common/buf/writer.go index 581a8668b..25a3d03f8 100644 --- a/common/buf/writer.go +++ b/common/buf/writer.go @@ -137,12 +137,8 @@ func (w *BufferedWriter) ReadFrom(reader io.Reader) (int64, error) { } w.buffered = false - - if readerFrom, ok := w.writer.(io.ReaderFrom); ok { - return readerFrom.ReadFrom(reader) - } - err := Copy(NewReader(reader), w, CountSize(&sc)) + return sc.Size, err }