code: func JitterUntil(f func(), period time.Duration, jitterFactor float64, sliding bool, stopCh <-chan struct{}) {
  	var t *time.Timer
  	var sawTimeout bool
  
  	for {
  		select {
  		case <-stopCh:
  			return
  		default:
  		}
  
  		jitteredPeriod := period
  		if jitterFactor > 0.0 {
  			jitteredPeriod = Jitter(period, jitterFactor)
  		}
  
  		if !sliding {
  			t = resetOrReuseTimer(t, jitteredPeriod, sawTimeout)
  		}
  
  		func() {
  			defer runtime.HandleCrash()
  			f()
  		}()
  
  		if sliding {
  			t = resetOrReuseTimer(t, jitteredPeriod, sawTimeout)
  		}
  
  		// NOTE: b/c there is no priority selection in golang
  		// it is possible for this to race, meaning we could
  		// trigger t.C and stopCh, and t.C select falls through.
  		// In order to mitigate we re-check stopCh at the beginning
  		// of every loop to prevent extra executions of f().
  		select {
  		case <-stopCh:
  			return
  		case <-t.C:
  			sawTimeout = true
  		}
  	}
  }
docs: // JitterUntil loops until stop channel is closed, running f every period.
  //
  // If jitterFactor is positive, the period is jittered before every run of f.
  // If jitterFactor is not positive, the period is unchanged and not jittered.
  //
  // If sliding is true, the period is computed after f runs. If it is false then
  // period includes the runtime for f.
  //
  // Close stopCh to stop. f may not be invoked if stop channel is already
  // closed. Pass NeverStop to if you don't want it stop.