From 16b3eaedac14f5e0090079ab995c55c87cf984b0 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 19 Jul 2019 04:54:33 +0200 Subject: [PATCH] Simplified return and bool check code --- pkg/commands/docker.go | 3 --- pkg/commands/os.go | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/commands/docker.go b/pkg/commands/docker.go index b712d1d7..86a70f90 100644 --- a/pkg/commands/docker.go +++ b/pkg/commands/docker.go @@ -144,8 +144,6 @@ func (c *DockerCommand) MonitorCLIContainerStats() { } cmd.Wait() - - return } // MonitorClientContainerStats is a function @@ -193,7 +191,6 @@ func (c *DockerCommand) createClientStatMonitor(container *Container) { } container.MonitoringStats = false - return } // RefreshContainersAndServices returns a slice of docker containers diff --git a/pkg/commands/os.go b/pkg/commands/os.go index 0d5682d5..d5a09914 100644 --- a/pkg/commands/os.go +++ b/pkg/commands/os.go @@ -336,7 +336,7 @@ func (c *OSCommand) Kill(cmd *exec.Cmd) error { // somebody got to it before we were able to, poor bastard return nil } - if cmd.SysProcAttr != nil && cmd.SysProcAttr.Setpgid == true { + if cmd.SysProcAttr != nil && cmd.SysProcAttr.Setpgid { // minus sign means we're talking about a PGID as opposed to a PID return syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL) }