code: func LimitChan(limit int) chan struct{} {
  	limitch := make(chan struct{}, limit)
  	for i := 0; i < limit; i++ {
  		limitch <- struct{}{}
  	}
  	return limitch
  }
docs: // LimitChan returns a rate-limiting channel. it is the usual, simple,
  // golang-idiomatic rate-limiting semaphore. This function merely
  // initializes it with certain buffer size, and sends that many values,
  // so it is ready to be used.