WriteTo check at if scope
Vladimir Bauer
6 years ago
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | func newProxyReader(r io.Reader, bar *Bar) io.ReadCloser { |
| 69 | wt, isWriterTo := r.(io.WriterTo) | |
| 70 | 69 | rc := toReadCloser(r) |
| 71 | 70 | rc = &proxyReader{rc, bar} |
| 72 | 71 | |
| 73 | if bar.hasEwmaDecorators { | |
| 72 | if wt, isWriterTo := r.(io.WriterTo); bar.hasEwmaDecorators { | |
| 74 | 73 | now := time.Now() |
| 75 | 74 | rc = &ewmaProxyReader{rc, bar, now} |
| 76 | 75 | if isWriterTo { |