don't panic
Vladimir Bauer
7 years ago
| 160 | 160 |
// ProxyReader wraps r with metrics required for progress tracking.
|
| 161 | 161 |
func (b *Bar) ProxyReader(r io.Reader) io.ReadCloser {
|
| 162 | 162 |
if r == nil {
|
| 163 | |
panic("expect io.Reader, got nil")
|
|
163 |
return nil
|
| 164 | 164 |
}
|
| 165 | 165 |
rc, ok := r.(io.ReadCloser)
|
| 166 | 166 |
if !ok {
|