mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-07-28 01:27:58 +00:00
fix(channels): explicitly ignore resp.Body.Close() errors in websocket dial cleanup
This commit is contained in:
@@ -88,7 +88,7 @@ func (c *PicoClientChannel) dial() error {
|
||||
|
||||
ws, resp, err := websocket.DefaultDialer.DialContext(c.ctx, c.config.URL, header)
|
||||
if resp != nil && resp.Body != nil {
|
||||
resp.Body.Close()
|
||||
_ = resp.Body.Close()
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -62,7 +62,7 @@ func (c *WhatsAppChannel) Start(ctx context.Context) error {
|
||||
|
||||
conn, resp, err := dialer.Dial(c.url, nil)
|
||||
if resp != nil {
|
||||
resp.Body.Close()
|
||||
_ = resp.Body.Close()
|
||||
}
|
||||
if err != nil {
|
||||
c.cancel()
|
||||
|
||||
Reference in New Issue
Block a user