mirror of https://github.com/usual2970/certimate
refactor: clean code
parent
39f8484b2a
commit
53133db456
|
@ -88,6 +88,9 @@ func (c *Client) sendRequest(method string, path string, params interface{}) (*r
|
|||
func (c *Client) sendRequestWithResult(method string, path string, params interface{}, result BaseResponse) error {
|
||||
resp, err := c.sendRequest(method, path, params)
|
||||
if err != nil {
|
||||
if resp != nil {
|
||||
json.Unmarshal(resp.Body(), &result)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -68,6 +68,9 @@ func (c *Client) sendRequest(method string, path string, params interface{}) (*r
|
|||
func (c *Client) sendRequestWithResult(method string, path string, params interface{}, result BaseResponse) error {
|
||||
resp, err := c.sendRequest(method, path, params)
|
||||
if err != nil {
|
||||
if resp != nil {
|
||||
json.Unmarshal(resp.Body(), &result)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,9 @@ func (c *Client) sendRequest(method string, path string, params interface{}) (*r
|
|||
func (c *Client) sendRequestWithResult(method string, path string, params interface{}, result BaseResponse) error {
|
||||
resp, err := c.sendRequest(method, path, params)
|
||||
if err != nil {
|
||||
if resp != nil {
|
||||
json.Unmarshal(resp.Body(), &result)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -69,6 +69,9 @@ func (c *Client) sendRequest(method string, path string, params interface{}) (*r
|
|||
func (c *Client) sendRequestWithResult(method string, path string, params interface{}, result BaseResponse) error {
|
||||
resp, err := c.sendRequest(method, path, params)
|
||||
if err != nil {
|
||||
if resp != nil {
|
||||
json.Unmarshal(resp.Body(), &result)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -56,6 +56,9 @@ func (c *Client) sendRequest(path string, params interface{}) (*resty.Response,
|
|||
func (c *Client) sendRequestWithResult(path string, params interface{}, result BaseResponse) error {
|
||||
resp, err := c.sendRequest(path, params)
|
||||
if err != nil {
|
||||
if resp != nil {
|
||||
json.Unmarshal(resp.Body(), &result)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -73,6 +73,9 @@ func (c *Client) sendRequest(method string, path string, params interface{}) (*r
|
|||
func (c *Client) sendRequestWithResult(method string, path string, params interface{}, result interface{}) error {
|
||||
resp, err := c.sendRequest(method, path, params)
|
||||
if err != nil {
|
||||
if resp != nil {
|
||||
json.Unmarshal(resp.Body(), &result)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue