mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
client.NewClientWithOpts(): remove redundant type assertion (gosimple)
As caught by gosimple: client/client.go:138:14: S1040: type assertion to the same type: c.client.Transport already has type http.RoundTripper (gosimple) if _, ok := c.client.Transport.(http.RoundTripper); !ok { ^ This check was originally added indc9f5c2ca3
, to check if the passed option was a `http.Transport`, and later changed ine345cd12f9
to check for `http.RoundTripper` instead. Client.client is a http.Client, for which the Transport field is a RoundTripper, so this check is redundant. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
b88f4e2604
commit
99935ff803
1 changed files with 0 additions and 3 deletions
|
@ -135,9 +135,6 @@ func NewClientWithOpts(ops ...Opt) (*Client, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := c.client.Transport.(http.RoundTripper); !ok {
|
|
||||||
return nil, fmt.Errorf("unable to verify TLS configuration, invalid transport %v", c.client.Transport)
|
|
||||||
}
|
|
||||||
if c.scheme == "" {
|
if c.scheme == "" {
|
||||||
c.scheme = "http"
|
c.scheme = "http"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue