From fe174cb8339a98f3106172989c1280a717e1b2e8 Mon Sep 17 00:00:00 2001 From: James Nesbitt Date: Tue, 7 May 2024 10:08:54 +0300 Subject: [PATCH] 195 Clone client gets setup() - client Clone() now runs setup() before returning (prevents nil segfault panic as clone is missing plumbing) Signed-off-by: James Nesbitt --- client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 5e5ca2b1..28272d3c 100644 --- a/client.go +++ b/client.go @@ -249,9 +249,11 @@ func (c *Client) String() string { func (c *Client) Clone(opts ...ClientOption) *Client { options := c.options.Clone() options.Apply(opts...) - return &Client{ + clone := &Client{ options: options, } + clone.setup() + return clone } // Sudo returns a copy of the connection with a Runner that uses sudo.