From 34705f3c6e3dcc73b6708e01b91b7e47980bcc52 Mon Sep 17 00:00:00 2001 From: koplas Date: Fri, 13 Jun 2025 11:00:22 +0200 Subject: [PATCH] Address comments --- csaf/validation.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/csaf/validation.go b/csaf/validation.go index 3faf549..598d0fa 100644 --- a/csaf/validation.go +++ b/csaf/validation.go @@ -76,11 +76,10 @@ func (l *schemaLoader) loadHTTPURL(url string) (any, error) { if err != nil { return nil, err } + defer resp.Body.Close() if resp.StatusCode != http.StatusOK { - _ = resp.Body.Close() return nil, fmt.Errorf("%s returned status code %d", url, resp.StatusCode) } - defer resp.Body.Close() return jsonschema.UnmarshalJSON(resp.Body) }