Fix linter issues

This commit is contained in:
Joshua Spence
2021-06-24 12:50:12 +10:00
committed by Paul Tyng
parent 496fcdf07c
commit 64a73cdd4b
3 changed files with 13 additions and 9 deletions

View File

@@ -247,7 +247,9 @@ func (c *Client) do(ctx context.Context, method, relativeURL string, reqBody int
errBody := struct {
Meta meta `json:"meta"`
}{}
err = json.NewDecoder(resp.Body).Decode(&errBody)
if err = json.NewDecoder(resp.Body).Decode(&errBody); err != nil {
return err
}
return fmt.Errorf("%w (%s) for %s %s", errBody.Meta.error(), resp.Status, method, url.String())
}