Skip to content

Commit

Permalink
195 Clone client gets setup()
Browse files Browse the repository at this point in the history
- client Clone() now runs setup() before returning
  (prevents nil segfault panic as clone is missing plumbing)

Signed-off-by: James Nesbitt <[email protected]>
  • Loading branch information
james-nesbitt committed May 7, 2024
1 parent db2e6d7 commit fe174cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Check failure on line 255 in client.go

View workflow job for this annotation

GitHub Actions / Lint

Error return value of `clone.setup` is not checked (errcheck)
return clone
}

// Sudo returns a copy of the connection with a Runner that uses sudo.
Expand Down

0 comments on commit fe174cb

Please sign in to comment.