From 4f087cb7f051ce64d84c6977f9e4f4c67a6f3892 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Wed, 28 May 2025 09:57:50 +0200 Subject: [PATCH] ignore errors Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com> --- gh-recon/utils.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gh-recon/utils.go b/gh-recon/utils.go index 3c46b21..6ade6c2 100644 --- a/gh-recon/utils.go +++ b/gh-recon/utils.go @@ -66,7 +66,9 @@ func FetchGitHubAPI(github *github.Client, token, path string) ([]byte, error) { if err != nil { return nil, fmt.Errorf("error executing request for %s: %w", url, err) } - defer resp.Body.Close() + defer func() { + _ = resp.Body.Close() + }() if resp.StatusCode < 200 || resp.StatusCode >= 300 { bodyBytes, _ := io.ReadAll(resp.Body) @@ -152,7 +154,9 @@ func (r Recon) WriteJson(data any) { r.Logger.Error("Failed to create JSON file", "err", err) return } - defer file.Close() + defer func() { + _ = file.Close() + }() as_json, _ := json.MarshalIndent(data, "", "\t") _, err = file.Write(as_json) if err != nil {