refactor: clean code
This commit is contained in:
3
internal/pkg/vendors/1panel-sdk/client.go
vendored
3
internal/pkg/vendors/1panel-sdk/client.go
vendored
@@ -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
|
||||
}
|
||||
|
||||
|
||||
3
internal/pkg/vendors/cachefly-sdk/client.go
vendored
3
internal/pkg/vendors/cachefly-sdk/client.go
vendored
@@ -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
|
||||
}
|
||||
|
||||
|
||||
3
internal/pkg/vendors/cdnfly-sdk/client.go
vendored
3
internal/pkg/vendors/cdnfly-sdk/client.go
vendored
@@ -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
|
||||
}
|
||||
|
||||
|
||||
3
internal/pkg/vendors/dnsla-sdk/client.go
vendored
3
internal/pkg/vendors/dnsla-sdk/client.go
vendored
@@ -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
|
||||
}
|
||||
|
||||
|
||||
3
internal/pkg/vendors/safeline-sdk/client.go
vendored
3
internal/pkg/vendors/safeline-sdk/client.go
vendored
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user