StopProgressIndicator stops the progress indicator if it is running. Note that a textual progess indicator does not create a progress indicator, so this method is a no-op in that case.
()
| 349 | // Note that a textual progess indicator does not create a progress indicator, |
| 350 | // so this method is a no-op in that case. |
| 351 | func (s *IOStreams) StopProgressIndicator() { |
| 352 | s.progressIndicatorMu.Lock() |
| 353 | defer s.progressIndicatorMu.Unlock() |
| 354 | if s.progressIndicator == nil { |
| 355 | return |
| 356 | } |
| 357 | s.progressIndicator.Stop() |
| 358 | s.progressIndicator = nil |
| 359 | } |
| 360 | |
| 361 | func (s *IOStreams) RunWithProgress(label string, run func() error) error { |
| 362 | s.StartProgressIndicatorWithLabel(label) |