Skip to content

Commit aa5fe04

Browse files
removing error handling for closure
1 parent fd85061 commit aa5fe04

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

connections/connection.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,7 @@ func ApiCallSetup(url string, target interface{}) error {
7676
if err != nil {
7777
return fmt.Errorf("error making GET request: %w", err)
7878
}
79-
defer func(Body io.ReadCloser) {
80-
err := Body.Close()
81-
if err != nil {
82-
}
83-
}(res.Body)
79+
defer res.Body.Close()
8480

8581
if res.StatusCode == http.StatusNotFound {
8682
fmt.Println(errorColor.Render("Page not found. 404 error."))

0 commit comments

Comments
 (0)