diff options
| author | Adnan Maolood <[email protected]> | 2021-01-15 15:15:16 -0500 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2021-01-15 15:18:00 -0500 |
| commit | 31de8d49b0d0a1d75addabfb2063b2a2176f19ea (patch) | |
| tree | 93a85ecdd60e2c16c92ff3d041986bd0a82eb3f8 /examples | |
| parent | fs: Remove unused import (diff) | |
| download | go-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.go | 2 |
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) |