ignore errors

Signed-off-by: Hadi <[email protected]>
This commit is contained in:
Hadi
2025-05-28 09:57:50 +02:00
parent befb546292
commit 4f087cb7f0
+6 -2
View File
@@ -66,7 +66,9 @@ func FetchGitHubAPI(github *github.Client, token, path string) ([]byte, error) {
if err != nil { if err != nil {
return nil, fmt.Errorf("error executing request for %s: %w", url, err) 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 { if resp.StatusCode < 200 || resp.StatusCode >= 300 {
bodyBytes, _ := io.ReadAll(resp.Body) 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) r.Logger.Error("Failed to create JSON file", "err", err)
return return
} }
defer file.Close() defer func() {
_ = file.Close()
}()
as_json, _ := json.MarshalIndent(data, "", "\t") as_json, _ := json.MarshalIndent(data, "", "\t")
_, err = file.Write(as_json) _, err = file.Write(as_json)
if err != nil { if err != nil {