Guarantee that (*Response).Body is not nil

This commit is contained in:
Adnan Maolood
2021-01-15 15:15:16 -05:00
parent 2b17f3d8eb
commit 31de8d49b0
3 changed files with 17 additions and 6 deletions

5
doc.go
View File

@@ -8,10 +8,7 @@ Client is a Gemini client.
if err != nil {
// handle error
}
if resp.Body != nil {
defer resp.Body.Close()
// ...
}
defer resp.Body.Close()
// ...
Server is a Gemini server.