diff --git a/proxyreader.go b/proxyreader.go index 0efb09a..316f438 100644 --- a/proxyreader.go +++ b/proxyreader.go @@ -67,11 +67,10 @@ } func newProxyReader(r io.Reader, bar *Bar) io.ReadCloser { - wt, isWriterTo := r.(io.WriterTo) rc := toReadCloser(r) rc = &proxyReader{rc, bar} - if bar.hasEwmaDecorators { + if wt, isWriterTo := r.(io.WriterTo); bar.hasEwmaDecorators { now := time.Now() rc = &ewmaProxyReader{rc, bar, now} if isWriterTo {