code: func ExponentialBackoff(backoff Backoff, logger Logger, condition ConditionFunc) error {
  	var err error
  	var ok bool
  	var curStep int
  	duration := backoff.Duration
  
  	for curStep = 0; curStep < backoff.Steps; curStep++ {
  
  		// Only sleep if it's not the first iteration.
  		if curStep != 0 {
  			adjusted := duration
  			if backoff.Jitter > 0.0 {
  				adjusted = Jitter(duration, backoff.Jitter)
  			}
  
  			logger.Printf("A retriable error occurred during function call, backing off for %v before retrying\n", adjusted)
  			time.Sleep(adjusted)
  			duration = time.Duration(float64(duration) * backoff.Factor)
  		}
  
  		// Execute function passed in.
  		ok, err = condition()
  
  		// If the function executed says it succeeded, stop retrying
  		if ok {
  			return nil
  		}
  
  		if err != nil {
  			// If the error is temporary, continue retrying.
  			if !IsTemporary(err) {
  				return err
  			} else {
  				// Print out the temporary error we experienced.
  				logger.Println(err)
  			}
  		}
  	}
  
  	if curStep > 1 {
  		logger.Printf("retried this function call %d time(s)", curStep)
  	}
  
  	// Provide more information to the user wherever possible
  	if err != nil {
  		return newRetryError(errors.Wrap(err, "ran out of retries"), curStep)
  	} else {
  		return newRetryError(errors.New("ran out of retries"), curStep)
  	}
  }
docs: // Modified version of the Kubernetes exponential-backoff code.
  // ExponentialBackoff repeats a condition check with exponential backoff.
  //
  // It checks the condition up to Steps times, increasing the wait by multiplying
  // the previous duration by Factor.
  //
  // If Jitter is greater than zero, a random amount of each duration is added
  // (between duration and duration*(1+jitter)).
  //
  // If the condition never returns true, ErrWaitTimeout is returned. Errors
  // do not cause the function to return.