Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
labuladong committed Jun 26, 2024
1 parent bfe57d5 commit 597be31
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pulsaradmin/pkg/rest/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ func (c *Client) newRequest(method, path string) (*request, error) {
return req, nil
}

func (c *Client) newRequestWithURL(method string, urlOpt *url.URL) (*request, error) {
func (c *Client) newRequestWithURL(method string, urlOpt *url.URL) *request {
req := &request{
method: method,
url: urlOpt,
params: make(url.Values),
}
return req, nil
return req
}

func (c *Client) doRequest(r *request) (*http.Response, error) {
Expand Down Expand Up @@ -114,10 +114,7 @@ func (c *Client) MakeRequest(method, endpoint string) (*http.Response, error) {
}

func (c *Client) MakeRequestWithURL(method string, urlOpt *url.URL) (*http.Response, error) {
req, err := c.newRequestWithURL(method, urlOpt)
if err != nil {
return nil, err
}
req := c.newRequestWithURL(method, urlOpt)

resp, err := checkSuccessful(c.doRequest(req))
if err != nil {
Expand Down

0 comments on commit 597be31

Please sign in to comment.