fix http client error handling

This commit is contained in:
ytsuchiya 2022-11-21 09:21:12 +09:00
parent 925654a748
commit 017fe6050f
1 changed files with 1 additions and 5 deletions

View File

@ -26,11 +26,7 @@ func (m *merger) merge(ctx context.Context, w io.Writer) error {
fmt.Printf("get url: %s", source.url)
return nil
}
defer func(Body io.ReadCloser) {
err := Body.Close()
if err != nil {
}
}(resp.Body)
defer resp.Body.Close()
tp := new(expfmt.TextParser)
out, err := tp.TextToMetricFamilies(resp.Body)
if err != nil {