Close closes the progress reader and its underlying reader.
()
| 51 | |
| 52 | // Close closes the progress reader and its underlying reader. |
| 53 | func (p *Reader) Close() error { |
| 54 | if p.current < p.size { |
| 55 | // print a full progress bar when closing prematurely |
| 56 | p.current = p.size |
| 57 | p.updateProgress(false) |
| 58 | } |
| 59 | return p.in.Close() |
| 60 | } |
| 61 | |
| 62 | func (p *Reader) updateProgress(last bool) { |
| 63 | if last || p.current == p.size || p.rateLimiter.Allow() { |
nothing calls this directly
no test coverage detected