浏览代码

fix client.HTTPClient() not returning a copy

```
14:26:43 client/client.go:255:9: SA4001: &*x will be simplified to x. It will not copy x. (staticcheck)
14:26:43 	return &*cli.client
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 6 年之前
父节点
当前提交
58b0585cd2
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      client/client.go

+ 2 - 1
client/client.go

@@ -252,7 +252,8 @@ func (cli *Client) DaemonHost() string {
 
 
 // HTTPClient returns a copy of the HTTP client bound to the server
 // HTTPClient returns a copy of the HTTP client bound to the server
 func (cli *Client) HTTPClient() *http.Client {
 func (cli *Client) HTTPClient() *http.Client {
-	return &*cli.client
+	c := *cli.client
+	return &c
 }
 }
 
 
 // ParseHostURL parses a url string, validates the string is a host url, and
 // ParseHostURL parses a url string, validates the string is a host url, and