refactoring io example
replace ioutil.Discard
Vladimir Bauer
2 years ago
| 2 | 2 |
import (
|
| 3 | 3 |
"crypto/rand"
|
| 4 | 4 |
"io"
|
| 5 | |
"io/ioutil"
|
| 6 | 5 |
"time"
|
| 7 | 6 |
|
| 8 | 7 |
"github.com/vbauerster/mpb/v8"
|
|
| 44 | 43 |
defer proxyReader.Close()
|
| 45 | 44 |
|
| 46 | 45 |
// copy from proxyReader, ignoring errors
|
| 47 | |
_, _ = io.Copy(ioutil.Discard, proxyReader)
|
|
46 |
_, _ = io.Copy(io.Discard, proxyReader)
|
| 48 | 47 |
|
| 49 | 48 |
p.Wait()
|
| 50 | 49 |
}
|