(quit chan bool)
| 62 | } |
| 63 | |
| 64 | func (progressReader *ProgressReader) printProgress(quit chan bool) { |
| 65 | timer := time.NewTicker(progressReader.outputInterval) |
| 66 | |
| 67 | for { |
| 68 | select { |
| 69 | case <-quit: |
| 70 | // The spaces are there to ensure we overwrite the entire line |
| 71 | // before using the terminal printer to output Done Uploading |
| 72 | progressReader.ui.PrintCapturingNoOutput("\r ") |
| 73 | progressReader.ui.Say("\rDone uploading") |
| 74 | return |
| 75 | case <-timer.C: |
| 76 | progressReader.mutex.RLock() |
| 77 | progressReader.ui.PrintCapturingNoOutput("\r%s uploaded...", formatters.ByteSize(progressReader.bytesRead)) |
| 78 | progressReader.mutex.RUnlock() |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | func (progressReader *ProgressReader) SetTotalSize(size int64) { |
| 84 | progressReader.total = size |
no test coverage detected