code: func (t *Throttler) Throttle() int {
  	if atomic.LoadInt32(&t.totalJobs) < 1 {
  		return int(atomic.LoadInt32(&t.errorCount))
  	}
  	atomic.AddInt32(&t.jobsStarted, 1)
  	atomic.AddInt32(&t.workerCount, 1)
  
  	// check to see if the current number of workers equals the max number of workers
  	// if they are equal, wait for one to finish before continuing
  	if atomic.LoadInt32(&t.workerCount) == atomic.LoadInt32(&t.maxWorkers) {
  		atomic.AddInt32(&t.jobsCompleted, 1)
  		atomic.AddInt32(&t.workerCount, -1)
  		<-t.doneChan
  	}
  
  	// check to see if all of the jobs have been started, and if so, wait until all
  	// jobs have been completed before continuing
  	if atomic.LoadInt32(&t.jobsStarted) == atomic.LoadInt32(&t.totalJobs) {
  		for atomic.LoadInt32(&t.jobsCompleted) < atomic.LoadInt32(&t.totalJobs) {
  			atomic.AddInt32(&t.jobsCompleted, 1)
  			<-t.doneChan
  		}
  	}
  
  	return int(atomic.LoadInt32(&t.errorCount))
  }
docs: // Throttle works similarly to sync.WaitGroup, except inside your goroutine dispatch
  // loop rather than after. It will not block until the number of active workers
  // matches the max number of workers designated in the call to NewThrottler or
  // all of the jobs have been dispatched. It stops blocking when Done has been called
  // as many times as totalJobs.