From 6bc176e3ef4bf59d901b79dd1a163ad8c43b7bca Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Thu, 25 Apr 2019 13:05:46 -0700 Subject: [PATCH] fix code safe linter errors --- cadvisor.go | 2 +- integration/runner/runner.go | 1 - utils/cpuload/netlink/reader.go | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cadvisor.go b/cadvisor.go index 2401ec72..150b1a2f 100644 --- a/cadvisor.go +++ b/cadvisor.go @@ -218,7 +218,7 @@ func setMaxProcs() { func installSignalHandler(containerManager manager.Manager) { c := make(chan os.Signal, 1) - signal.Notify(c, os.Interrupt, os.Kill, syscall.SIGTERM) + signal.Notify(c, os.Interrupt, syscall.SIGTERM) // Block until a signal is received. go func() { diff --git a/integration/runner/runner.go b/integration/runner/runner.go index da5e3b1e..63c2d335 100644 --- a/integration/runner/runner.go +++ b/integration/runner/runner.go @@ -162,7 +162,6 @@ func PushAndRunTests(host, testDir string) (result error) { resp, err := http.Get(fmt.Sprintf("http://%s:%s/healthz", host, portStr)) if err == nil && resp.StatusCode == http.StatusOK { done = true - break } } } diff --git a/utils/cpuload/netlink/reader.go b/utils/cpuload/netlink/reader.go index 72369552..2e2b96f3 100644 --- a/utils/cpuload/netlink/reader.go +++ b/utils/cpuload/netlink/reader.go @@ -66,10 +66,10 @@ func (self *NetlinkReader) GetCpuLoad(name string, path string) (info.LoadStats, } cfd, err := os.Open(path) - defer cfd.Close() if err != nil { return info.LoadStats{}, fmt.Errorf("failed to open cgroup path %s: %q", path, err) } + defer cfd.Close() stats, err := getLoadStats(self.familyId, cfd, self.conn) if err != nil {