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 {
|
||||
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 {
|
||||
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 {
|
||||
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 {
|
||||
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)
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
defer resp.Body.Close() // nolint
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
e := struct {
|
||||
|
||||
Reference in New Issue
Block a user