Open max-min opened 5 years ago
We just left the connOption part out in our mock since it is optional. This is kind of what our connect looks like
type stubZkClient struct {
ConnectStub struct {
called int
servers []string
sessionTimeout time.Duration
zkConn ZkConn
eventChan chan zk.Event
err error
}
}
func (c *stubZkClient) Connect(servers []string, sessionTimeout time.Duration) (ZkConn, <-chan zk.Event, error) {
c.ConnectStub.called++
c.ConnectStub.servers = servers
c.ConnectStub.sessionTimeout = sessionTimeout
return c.ConnectStub.zkConn, c.ConnectStub.eventChan, c.ConnectStub.err
}
https://github.com/samuel/go-zookeeper/blob/c4fab1ac1bec58281ad0667dc3f0907a9476ac47/zk/conn.go#L175
connOption
is not friendly ...