progressMeter is a `Progress` that reports the current state every `period` to an `io.Writer`.
| 32 | // progressMeter is a `Progress` that reports the current state every |
| 33 | // `period` to an `io.Writer`. |
| 34 | type progressMeter struct { |
| 35 | lock sync.Mutex |
| 36 | w io.Writer |
| 37 | format string |
| 38 | period time.Duration |
| 39 | lastShownCount int64 |
| 40 | spinnerIndex int |
| 41 | // When `ticker` is changed, that tells the old goroutine that |
| 42 | // it's time to shut down. |
| 43 | ticker *time.Ticker |
| 44 | |
| 45 | // `count` is updated atomically: |
| 46 | count int64 |
| 47 | } |
| 48 | |
| 49 | // NewProgressMeter returns a progress meter that can be used to show |
| 50 | // progress to a TTY periodically, including an increasing int64 |
nothing calls this directly
no outgoing calls
no test coverage detected