Skip to content

Commit 454b32f

Browse files
chore: handle error returned by NewRequest
Signed-off-by: Siddhant N Trivedi <siddhant@deepsource.io>
1 parent 47c32ad commit 454b32f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

command/report/query.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ func makeQuery(url string, body []byte, bodyMimeType string) ([]byte, error) {
1717
Timeout: time.Second * 60,
1818
}
1919

20-
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(body))
20+
req, err := http.NewRequest("POST", url, bytes.NewBuffer(body))
21+
if err != nil {
22+
return nil, err
23+
}
2124
req.Header.Set("Content-Type", bodyMimeType)
2225
res, err := httpClient.Do(req)
2326
if err != nil {

0 commit comments

Comments
 (0)