code: func (c *consulClientImpl) reconnect(conn *consulConnection) error {
  	var err error
  
  	// once.Do executes func() only once across concurrently executing threads
  	conn.once.Do(func() {
  		var config *api.Config
  		var client *api.Client
  
  		for _, machine := range c.connParams.machines {
  			if strings.HasPrefix(machine, "http://") {
  				machine = strings.TrimPrefix(machine, "http://")
  			} else if strings.HasPrefix(machine, "https://") {
  				machine = strings.TrimPrefix(machine, "https://")
  			}
  
  			// sleep for requested delay before testing new connection
  			time.Sleep(c.reconnectDelay)
  			if config, client, err = newKvClient(machine, c.connParams); err == nil {
  				c.conn = &consulConnection{
  					client: client,
  					config: config,
  					once:   new(sync.Once),
  				}
  				logrus.Infof("%s: %s\n", "successfully connected to", machine)
  				break
  			} else {
  				logrus.Errorf("failed to reconnect client on: %s", machine)
  			}
  		}
  	})
  
  	if err != nil {
  		logrus.Infof("Failed to reconnect client: %v", err)
  	}
  	return err
  }
docs: // reconnect reconnectes to any online and healthy consul server..