code: func (d *Downloader) cancel() {
  	// Close the current cancel channel
  	d.cancelLock.Lock()
  	if d.cancelCh != nil {
  		select {
  		case <-d.cancelCh:
  			// Channel was already closed
  		default:
  			close(d.cancelCh)
  		}
  	}
  	d.cancelLock.Unlock()
  }
docs: // cancel aborts all of the operations and resets the queue. However, cancel does
  // not wait for the running download goroutines to finish. This method should be
  // used when cancelling the downloads from inside the downloader.