code: func New(permits int) *Semaphore {
  	if permits < 1 {
  		panic("Invalid number of permits. Less than 1")
  	}
  
  	// fill channel buffer
  	channel := make(chan struct{}, permits)
  	for i := 0; i < permits; i++ {
  		channel <- struct{}{}
  	}
  
  	return &Semaphore{
  		permits: permits,
  		avail:   permits,
  		channel: channel,
  	}
  }
docs: // New creates a new Semaphore with specified number of permits.