From c3aa8c088cd65954a25ee7c001d66ca243b43d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E6=99=BA=E8=B6=850668000959?= Date: Mon, 15 Jun 2026 20:28:22 +0800 Subject: [PATCH] fix(web): explicitly ignore resp.Body.Close() errors after io.ReadAll --- pkg/tools/integration/web.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/tools/integration/web.go b/pkg/tools/integration/web.go index d7a3112ae..322094193 100644 --- a/pkg/tools/integration/web.go +++ b/pkg/tools/integration/web.go @@ -315,7 +315,7 @@ func (p *BraveSearchProvider) Search( } body, err := io.ReadAll(resp.Body) - resp.Body.Close() + _ = resp.Body.Close() if err != nil { lastErr = fmt.Errorf("failed to read response: %w", err) @@ -448,7 +448,7 @@ func (p *TavilySearchProvider) Search( } body, err := io.ReadAll(resp.Body) - resp.Body.Close() + _ = resp.Body.Close() if err != nil { lastErr = fmt.Errorf("failed to read response: %w", err) @@ -906,7 +906,7 @@ func (p *SogouSearchProvider) Search( } body, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) - resp.Body.Close() + _ = resp.Body.Close() if err != nil { return "", fmt.Errorf("failed to read response: %w", err) } @@ -1147,7 +1147,7 @@ func (p *PerplexitySearchProvider) Search( } body, err := io.ReadAll(resp.Body) - resp.Body.Close() + _ = resp.Body.Close() if err != nil { lastErr = fmt.Errorf("failed to read response: %w", err)