refactor: clean code

This commit is contained in:
Fu Diwei
2025-05-16 13:56:45 +08:00
parent dd2087b101
commit b15bf8ef98
17 changed files with 32 additions and 32 deletions

View File

@@ -20,7 +20,7 @@ func (c *Client) getAccessToken() error {
resp := &getAPIAccessTokenResponse{}
if err := json.Unmarshal(res.Body(), &resp); err != nil {
return fmt.Errorf("goedge api error: failed to parse response: %w", err)
return fmt.Errorf("goedge api error: failed to unmarshal response: %w", err)
} else if resp.GetCode() != 200 {
return fmt.Errorf("goedge get access token failed: code: %d, message: %s", resp.GetCode(), resp.GetMessage())
}