NewClient nil ClientConfig should use dynamic port

It's pretty hard to test otherwise, if something's already on the default port.
This commit is contained in:
Matt Joiner 2019-07-30 17:19:14 +10:00
parent cbc98e17aa
commit 0b15fda7a8
1 changed files with 1 additions and 0 deletions

View File

@ -173,6 +173,7 @@ func (cl *Client) announceKey() int32 {
func NewClient(cfg *ClientConfig) (cl *Client, err error) {
if cfg == nil {
cfg = NewDefaultClientConfig()
cfg.ListenPort = 0
}
defer func() {
if err != nil {