Skip to content

Commit 9cf6e2b

Browse files
committed
fix: close res body metafates#205
1 parent 7232103 commit 9cf6e2b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

installer/scraper.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import (
44
"encoding/base64"
55
"encoding/json"
66
"fmt"
7-
"github.com/metafates/mangal/filesystem"
8-
"github.com/metafates/mangal/where"
97
"io"
108
"net/http"
119
"os"
1210
"path/filepath"
11+
12+
"github.com/metafates/mangal/filesystem"
13+
"github.com/metafates/mangal/util"
14+
"github.com/metafates/mangal/where"
1315
)
1416

1517
type Scraper struct {
@@ -42,6 +44,8 @@ func (s *Scraper) download() error {
4244
return err
4345
}
4446

47+
defer util.Ignore(res.Body.Close)
48+
4549
if res.StatusCode != http.StatusOK {
4650
return fmt.Errorf("failed to get %s: %s", s.URL, res.Status)
4751
}

0 commit comments

Comments
 (0)