code: func (s *Semaphore) AcquireContext(ctx context.Context, n int) bool {
  	acquired := make(chan struct{}, 1)
  	reverse := make(chan bool, 1)
  	go func() {
  		s.AcquireMany(n)
  		acquired <- struct{}{}
  		if <-reverse {
  			s.ReleaseMany(n)
  		}
  		close(acquired)
  		close(reverse)
  	}()
  
  	select {
  	case <-ctx.Done():
  		reverse <- true
  		return false
  	case <-acquired:
  		reverse <- false
  		return true
  	}
  }
docs: // AcquireContext is similar to AcquireMany() but takes a context. Returns true if successful
  // or false if the context is done first.