From e5c5a99a0c9e8de2568931959d626c40e86bac9e Mon Sep 17 00:00:00 2001 From: Ties de Kock Date: Mon, 25 Oct 2021 20:19:28 +0200 Subject: [PATCH] check for err --- utils/utils.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/utils.go b/utils/utils.go index ec6b9f7..9aac46d 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -72,6 +72,10 @@ func (c *FetchConfig) FetchFile(file string) ([]byte, int, bool, error) { client := &http.Client{Transport: tr} req, err := http.NewRequest("GET", file, nil) + if err != nil { + return nil, -1, false, err + } + req.Header.Set("User-Agent", c.UserAgent) if c.Mime != "" { req.Header.Set("Accept", c.Mime)