Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Apr 15, 2024
1 parent 1bb652d commit 3a345c6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/feeder/rfc6962/rfc6962_feeder.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ func getJSON(ctx context.Context, c *http.Client, base *url.URL, path string, s
return fmt.Errorf("failed to get: %v", err)
}
if err := json.Unmarshal(raw, s); err != nil {
klog.Infof("Got body:\n%s", string(raw))
return fmt.Errorf("failed to unmarshal JSON: %v", err)
}
return nil
Expand All @@ -133,7 +132,11 @@ func get(ctx context.Context, c *http.Client, base *url.URL, path string) ([]byt
if err != nil {
return nil, fmt.Errorf("failed to make request to %q: %v", u.String(), err)
}
defer rsp.Body.Close()
defer func() {
if err := rsp.Body.Close(); err != nil {
klog.Infof("Close: %v", err)
}
}()

if rsp.StatusCode == 404 {
return nil, os.ErrNotExist
Expand Down

0 comments on commit 3a345c6

Please sign in to comment.