mirror of
https://github.com/kemko/reproxy.git
synced 2026-01-01 15:55:49 +03:00
lint: minor warn on deferred close
This commit is contained in:
@@ -66,7 +66,7 @@ func (cl *consulClient) getServiceNames() ([]string, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error send request to consul, %w", err)
|
return nil, fmt.Errorf("error send request to consul, %w", err)
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close() // nolint
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
return nil, fmt.Errorf("unexpected response status code %d", resp.StatusCode)
|
return nil, fmt.Errorf("unexpected response status code %d", resp.StatusCode)
|
||||||
@@ -107,7 +107,7 @@ func (cl *consulClient) getServices(serviceName string) ([]consulService, error)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error send request to consul, %w", err)
|
return nil, fmt.Errorf("error send request to consul, %w", err)
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close() // nolint
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
return nil, fmt.Errorf("unexpected response status code %d", resp.StatusCode)
|
return nil, fmt.Errorf("unexpected response status code %d", resp.StatusCode)
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ func (d *dockerClient) ListContainers() ([]containerInfo, error) {
|
|||||||
return nil, fmt.Errorf("failed connection to docker socket: %w", err)
|
return nil, fmt.Errorf("failed connection to docker socket: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close() // nolint
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
e := struct {
|
e := struct {
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ func (p *Plugin) send(client *http.Client, conductor, method string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close() // nolint
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
return fmt.Errorf("invalid status %s", resp.Status)
|
return fmt.Errorf("invalid status %s", resp.Status)
|
||||||
|
|||||||
Reference in New Issue
Block a user