code: func newTCPConnection(address string, timeout, readTimeout time.Duration) (*connection, error) {
  	var fetchVersions = true
  	for {
  		dialer := net.Dialer{
  			Timeout:   timeout,
  			KeepAlive: 30 * time.Second,
  		}
  		conn, err := dialer.Dial("tcp", address)
  		if err != nil {
  			return nil, err
  		}
  		c := &connection{
  			stop:        make(chan struct{}),
  			nextID:      make(chan int32),
  			rw:          conn,
  			respc:       make(map[int32]chan []byte),
  			logger:      &nullLogger{},
  			readTimeout: readTimeout,
  			apiVersions: make(map[int16]proto.SupportedVersion),
  		}
  		go c.nextIDLoop()
  		go c.readRespLoop()
  
  		if fetchVersions {
  			if c.cacheApiVersions() != nil {
  				fetchVersions = false
  				//required for errorchk
  				_ = c.Close()
  				continue
  			}
  		}
  		return c, nil
  	}
  
  }
docs: // newConnection returns new, initialized connection or error