fix(lint): resolve errcheck and bodyclose warnings for golangci-lint v2
This commit is contained in:
parent
64d31bf4ed
commit
104820f4fe
7 changed files with 13 additions and 10 deletions
|
|
@ -67,7 +67,10 @@ func (t *WSTransport) Connect(ctx context.Context) error {
|
|||
wsURLWithKey += sep + "key=" + t.apiKey
|
||||
}
|
||||
|
||||
conn, _, err := dialer.DialContext(ctx, wsURLWithKey, header)
|
||||
conn, wsResp, err := dialer.DialContext(ctx, wsURLWithKey, header)
|
||||
if wsResp != nil && wsResp.Body != nil {
|
||||
defer wsResp.Body.Close() //nolint:errcheck
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("ws dial: %w", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue