fix(channels): explicitly ignore resp.Body.Close() errors in websocket dial cleanup

This commit is contained in:
程智超0668000959
2026-06-26 22:15:03 +08:00
parent dff16dbb91
commit 1bd2e84527
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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()