aboutsummaryrefslogtreecommitdiff
path: root/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'util.go')
-rw-r--r--util.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/util.go b/util.go
index dddd7db..ac3e3e4 100644
--- a/util.go
+++ b/util.go
@@ -94,7 +94,11 @@ func request(uri string, other ...string) reqrt {
r.Err = e
return r
}
- defer resp.Body.Close()
+ defer func() {
+ if err := resp.Body.Close(); err != nil {
+ try(err)
+ }
+ }()
body, e := io.ReadAll(resp.Body)
if e != nil {