refactor: clean code

This commit is contained in:
Fu Diwei
2025-02-21 17:28:58 +08:00
parent f81fa2eb63
commit 97356328be
7 changed files with 32 additions and 20 deletions

View File

@@ -39,10 +39,12 @@ func (c *Client) sendRequest(method string, path string, params interface{}) (*r
qs := make(map[string]string)
if params != nil {
temp := make(map[string]any)
jsonData, _ := json.Marshal(params)
json.Unmarshal(jsonData, &temp)
jsonb, _ := json.Marshal(params)
json.Unmarshal(jsonb, &temp)
for k, v := range temp {
qs[k] = fmt.Sprintf("%v", v)
if v != nil {
qs[k] = fmt.Sprintf("%v", v)
}
}
}