StopProgressIndicator stops the progress indicator if it is running. Note that a textual progress indicator does not create a progress indicator, so this method is a no-op in that case.
()
| 361 | // Note that a textual progress indicator does not create a progress indicator, |
| 362 | // so this method is a no-op in that case. |
| 363 | func (s *IOStreams) StopProgressIndicator() { |
| 364 | s.progressIndicatorMu.Lock() |
| 365 | defer s.progressIndicatorMu.Unlock() |
| 366 | if s.progressIndicator == nil { |
| 367 | return |
| 368 | } |
| 369 | s.progressIndicator.Stop() |
| 370 | s.progressIndicator = nil |
| 371 | } |
| 372 | |
| 373 | func (s *IOStreams) RunWithProgress(label string, run func() error) error { |
| 374 | s.StartProgressIndicatorWithLabel(label) |