refactor: remove dead doWithHeaders/extraHeaders code from CLI API client
All checks were successful
check / check (push) Successful in 4s
All checks were successful
check / check (push) Successful in 4s
This commit is contained in:
@@ -278,16 +278,6 @@ func (client *Client) GetServerInfo() (
|
|||||||
func (client *Client) do(
|
func (client *Client) do(
|
||||||
method, path string,
|
method, path string,
|
||||||
body any,
|
body any,
|
||||||
) ([]byte, error) {
|
|
||||||
return client.doWithHeaders(
|
|
||||||
method, path, body, nil,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (client *Client) doWithHeaders(
|
|
||||||
method, path string,
|
|
||||||
body any,
|
|
||||||
extraHeaders map[string]string,
|
|
||||||
) ([]byte, error) {
|
) ([]byte, error) {
|
||||||
var bodyReader io.Reader
|
var bodyReader io.Reader
|
||||||
|
|
||||||
@@ -320,10 +310,6 @@ func (client *Client) doWithHeaders(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
for key, val := range extraHeaders {
|
|
||||||
request.Header.Set(key, val)
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := client.HTTPClient.Do(request)
|
resp, err := client.HTTPClient.Do(request)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("http: %w", err)
|
return nil, fmt.Errorf("http: %w", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user