func (b *Policy) GetBackoffDuration(numErrors int) time.Duration {
	var backoffTime float64

	if numErrors > 0 {
		backoffTime = b.BaseBackoffTime * math.Pow(2, float64(numErrors))

		if backoffTime > b.MaxBackoffTime {
			backoffTime = b.MaxBackoffTime
		} else {
			min := backoffTime / b.MinBackoffFactor
			max := math.Min(b.MaxBackoffTime, backoffTime)
			backoffTime = randomBetween(min, max)
		}
	}

	return time.Duration(backoffTime * secondsFloat)

}
// GetBackoffDuration returns amount of time to sleep after numErrors error
GetBackoffDuration returns amount of time to sleep after numErrors error
// GetBackoffDuration returns amount of time to sleep after numErrors error
func (b *Policy) GetBackoffDuration(numErrors int) time.Duration {
	var backoffTime float64
	if numErrors > 0 {
		backoffTime = b.BaseBackoffTime * math.Pow(2, float64(numErrors))
		if backoffTime > b.MaxBackoffTime {
			backoffTime = b.MaxBackoffTime
		} else {
			min := backoffTime / b.MinBackoffFactor
			max := math.Min(b.MaxBackoffTime, backoffTime)
			backoffTime = randomBetween(min, max)
		}
	}
	return time.Duration(backoffTime * secondsFloat)
}
func ( b * Policy ) GetBackoffDuration ( numErrors int ) time . Duration { var backoffTime float64 if numErrors > 0 { backoffTime = b . BaseBackoffTime * math . Pow ( 2 , float64 ( numErrors ) ) if backoffTime > b . MaxBackoffTime { backoffTime = b . MaxBackoffTime } else { min := backoffTime / b . MinBackoffFactor max := math . Min ( b . MaxBackoffTime , backoffTime ) backoffTime = randomBetween ( min , max ) } } return time . Duration ( backoffTime * secondsFloat ) }
GetBackoffDuration returns amount of time to sleep after numErrors error
GetBackoffDuration returns amount of time to sleep after numErrors error