From 0b15fda7a8e2c3c1f65ba47ec5ea816c08bec14a Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Tue, 30 Jul 2019 17:19:14 +1000 Subject: [PATCH] NewClient nil ClientConfig should use dynamic port It's pretty hard to test otherwise, if something's already on the default port. --- client.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client.go b/client.go index db0fae18..c6801cf1 100644 --- a/client.go +++ b/client.go @@ -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 { -- 2.48.1