mirror of
https://github.com/umputun/reproxy.git
synced 2025-11-23 22:04:57 +02: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 {
|
||||
|
||||
@@ -103,7 +103,7 @@ func (p *Plugin) send(client *http.Client, conductor, method string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer resp.Body.Close() // nolint
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return fmt.Errorf("invalid status %s", resp.Status)
|
||||
|
||||
Reference in New Issue
Block a user