code: func retry(ctx context.Context, f func() bool, delay time.Duration) error {
  	if f() {
  		return nil
  	}
  
  	ticker := time.NewTicker(delay)
  	errChan := make(chan error)
  
  	go func() {
  		defer close(errChan)
  
  		for {
  			select {
  			case <-ctx.Done():
  				errChan <- ctx.Err()
  				return
  			case <-ticker.C:
  				if f() {
  					return
  				}
  			}
  		}
  	}()
  
  	return <-errChan
  }
docs: // retry calls function f indefinitely with the given delay between invocations
  // until f returns true or the given context is cancelled.
  // It returns immediately without delay in case function f immediately returns true.