code: func (tr *Transport) AutoUpdate(certUpdates chan<- time.Time, errChan chan<- error) {
  	defer func() {
  		if r := recover(); r != nil {
  			log.Criticalf("AutoUpdate panicked: %v", r)
  		}
  	}()
  
  	for {
  		// Wait until it's time to update the certificate.
  		target := time.Now().Add(tr.Lifespan())
  		if PollInterval == 0 {
  			<-time.After(tr.Lifespan())
  		} else {
  			pollWait(target)
  		}
  
  		// Keep trying to update the certificate until it's
  		// ready.
  		for {
  			log.Debugf("attempting to refresh keypair")
  			err := tr.RefreshKeys()
  			if err == nil {
  				break
  			}
  
  			delay := tr.Backoff.Duration()
  			log.Debugf("failed to update certificate, will try again in %s", delay)
  			if errChan != nil {
  				errChan <- err
  			}
  
  			<-time.After(delay)
  		}
  
  		log.Debugf("certificate updated")
  		if certUpdates != nil {
  			certUpdates <- time.Now()
  		}
  
  		tr.Backoff.Reset()
  	}
  }
docs: // AutoUpdate will automatically update the listener. If a non-nil
  // certUpdates chan is provided, it will receive timestamps for
  // reissued certificates. If errChan is non-nil, any errors that occur
  // in the updater will be passed along.