diff options
| author | Adnan Maolood <[email protected]> | 2020-11-08 18:38:08 -0500 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2020-11-08 18:38:08 -0500 |
| commit | 5332dc628043a5c0d18652ebf4b89576de7af653 (patch) | |
| tree | 5ad63d218219c2e5979850a44d00de92f9297d61 /doc.go | |
| parent | Fix relative redirects (diff) | |
| download | go-gemini-5332dc628043a5c0d18652ebf4b89576de7af653.tar.xz go-gemini-5332dc628043a5c0d18652ebf4b89576de7af653.zip | |
Don't guarantee that (*Response).Body is always non-nil
Diffstat (limited to 'doc.go')
| -rw-r--r-- | doc.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -7,7 +7,10 @@ Get makes a Gemini request: if err != nil { // handle error } - defer resp.Body.Close() + if resp.Status.Class() == gemini.StatusClassSucess { + defer resp.Body.Close() + // ... + } // ... For control over client behavior, create a Client: |