diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2026-07-09 15:59:57 -0230 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2026-07-09 15:59:57 -0230 |
| commit | 477165c4233d84b3557c4fc3aed021ce0fae4a58 (patch) | |
| tree | 445ac46b186109789d9adbdd8d65c1bf44d79c38 | |
| parent | 10f997049d8b4240153db239df05ec7e8f4bae17 (diff) | |
| download | exchange-477165c4233d84b3557c4fc3aed021ce0fae4a58.zip | |
perf: remove debug buffer
| -rw-r--r-- | exchange.go | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/exchange.go b/exchange.go index 3b45d0d..a129889 100644 --- a/exchange.go +++ b/exchange.go @@ -8,7 +8,6 @@ package exchange import ( - "bytes" "cmp" "encoding/json" "fmt" @@ -141,17 +140,8 @@ func get[T any](c *Client, path string, query url.Values, resp *T) error { func decOkResp[T any](hresp *http.Response) (T, error) { var resp response[T] - - // TODO: remove once debugged - buf := new(bytes.Buffer) - _, err := buf.ReadFrom(hresp.Body) - if err != nil { - return resp.Data, err - } - debugf("raw response: %s\n", buf.String()) - dec := json.NewDecoder(buf) - - err = dec.Decode(&resp) + dec := json.NewDecoder(hresp.Body) + err := dec.Decode(&resp) debugf("decoded response: %v\n", resp) if err == nil && resp.Status.Error != "" { err = fmt.Errorf("%s", resp.Status.Error) |