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> (cherry picked from commit99935ff803
) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
0523323c28
commit
e6aee04a88
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 == "" {
|
||||
c.scheme = "http"
|
||||
|
||||
|
|
Loading…
Reference in a new issue