1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 05:40:11 +01:00

Address comments
Some checks failed
Go / build (push) Has been cancelled

This commit is contained in:
koplas 2025-06-13 11:00:22 +02:00
parent 6955c4e37c
commit 34705f3c6e

View file

@ -76,11 +76,10 @@ func (l *schemaLoader) loadHTTPURL(url string) (any, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK { if resp.StatusCode != http.StatusOK {
_ = resp.Body.Close()
return nil, fmt.Errorf("%s returned status code %d", url, resp.StatusCode) return nil, fmt.Errorf("%s returned status code %d", url, resp.StatusCode)
} }
defer resp.Body.Close()
return jsonschema.UnmarshalJSON(resp.Body) return jsonschema.UnmarshalJSON(resp.Body)
} }