From 597be31aa752ef2187ba49c3397272b2998b32ca Mon Sep 17 00:00:00 2001 From: labuladong Date: Wed, 26 Jun 2024 13:35:30 +0800 Subject: [PATCH] fix lint --- pulsaradmin/pkg/rest/client.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pulsaradmin/pkg/rest/client.go b/pulsaradmin/pkg/rest/client.go index 61382a2a5d..6541cf50c6 100644 --- a/pulsaradmin/pkg/rest/client.go +++ b/pulsaradmin/pkg/rest/client.go @@ -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) { @@ -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 {