summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorSebastiaan van Stijn <github@gone.nl>2022-01-31 11:26:26 +0100
committerSebastiaan van Stijn <github@gone.nl>2022-02-08 09:43:25 +0100
commit99935ff80314da0d32f7725c9c976ad4d822d52a (patch)
treed55b506207bc58ae26eadcb7b299a79239a8e0df /client
parentb88f4e26046994a15af9bcc28d3a0a91492908b9 (diff)
downloaddocker-99935ff80314da0d32f7725c9c976ad4d822d52a.tar.gz
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 in dc9f5c2ca3cdf8fef5786a80a0a1b0e7c18d4420, to check if the passed option was a `http.Transport`, and later changed in e345cd12f96b3985257652b606c8463a5772944b 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>
Diffstat (limited to 'client')
-rw-r--r--client/client.go3
1 files changed, 0 insertions, 3 deletions
diff --git a/client/client.go b/client/client.go
index fa511897e0..6a8b4d4fea 100644
--- a/client/client.go
+++ b/client/client.go
@@ -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 == "" {
c.scheme = "http"