aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-01-15 15:15:16 -0500
committerAdnan Maolood <[email protected]>2021-01-15 15:18:00 -0500
commit31de8d49b0d0a1d75addabfb2063b2a2176f19ea (patch)
tree93a85ecdd60e2c16c92ff3d041986bd0a82eb3f8 /examples
parentfs: Remove unused import (diff)
downloadgo-gemini-31de8d49b0d0a1d75addabfb2063b2a2176f19ea.tar.xz
go-gemini-31de8d49b0d0a1d75addabfb2063b2a2176f19ea.zip
Guarantee that (*Response).Body is not nilv0.1.13
Diffstat (limited to 'examples')
-rw-r--r--examples/client.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/client.go b/examples/client.go
index 97a197a..4135070 100644
--- a/examples/client.go
+++ b/examples/client.go
@@ -145,10 +145,10 @@ func main() {
fmt.Println(err)
os.Exit(1)
}
+ defer resp.Body.Close()
// Handle response
if resp.Status.Class() == gemini.StatusClassSuccess {
- defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)