diff options
| author | Adnan Maolood <[email protected]> | 2021-02-09 09:41:36 -0500 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2021-02-09 09:46:13 -0500 |
| commit | 5ef5824d6f7c8c709009265e4fd8c6c8ff9ccf70 (patch) | |
| tree | 636c8af55092292d2263a8d84ef61633f5c8258e /examples | |
| parent | Update README.md (diff) | |
| download | go-gemini-5ef5824d6f7c8c709009265e4fd8c6c8ff9ccf70.tar.xz go-gemini-5ef5824d6f7c8c709009265e4fd8c6c8ff9ccf70.zip | |
Use plain integers to represent status codes
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/client.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/client.go b/examples/client.go index 4135070..d9e2d14 100644 --- a/examples/client.go +++ b/examples/client.go @@ -95,7 +95,7 @@ func do(req *gemini.Request, via []*gemini.Request) (*gemini.Response, error) { return resp, err } - switch resp.Status.Class() { + switch gemini.StatusClass(resp.Status) { case gemini.StatusClassInput: input, ok := getInput(resp.Meta, resp.Status == gemini.StatusSensitiveInput) if !ok { @@ -148,7 +148,7 @@ func main() { defer resp.Body.Close() // Handle response - if resp.Status.Class() == gemini.StatusClassSuccess { + if gemini.StatusClass(resp.Status) == gemini.StatusClassSuccess { body, err := ioutil.ReadAll(resp.Body) if err != nil { log.Fatal(err) |