code: func (t *transfer) Broadcast(masterProgressChan <-chan progress.Progress) {
  	for {
  		var (
  			p  progress.Progress
  			ok bool
  		)
  		select {
  		case p, ok = <-masterProgressChan:
  		default:
  			// We've depleted the channel, so now we can handle
  			// reads on broadcastSyncChan to let detaching watchers
  			// know we're caught up.
  			select {
  			case <-t.broadcastSyncChan:
  				continue
  			case p, ok = <-masterProgressChan:
  			}
  		}
  
  		t.mu.Lock()
  		if ok {
  			t.lastProgress = p
  			t.hasLastProgress = true
  			for _, w := range t.watchers {
  				select {
  				case w.signalChan <- struct{}{}:
  				default:
  				}
  			}
  		} else {
  			t.broadcastDone = true
  		}
  		t.mu.Unlock()
  		if !ok {
  			close(t.running)
  			return
  		}
  	}
  }
docs: // Broadcast copies the progress and error output to all viewers.