code: func (rw *RetryWaiter) calculateWait() time.Duration {
  	waitTime := rw.minWait
  	if rw.failures > rw.minFailures {
  		shift := rw.failures - rw.minFailures - 1
  		waitTime = rw.maxWait
  		if shift < 31 {
  			waitTime = (1 << shift) * time.Second
  		}
  		if waitTime > rw.maxWait {
  			waitTime = rw.maxWait
  		}
  
  		if rw.jitter != nil {
  			waitTime = rw.jitter.AddJitter(waitTime)
  		}
  	}
  
  	if waitTime < rw.minWait {
  		waitTime = rw.minWait
  	}
  
  	return waitTime
  }
docs: // calculates the necessary wait time before the
  // next operation should be allowed.