From 308d079c68600dc544e2130ce69d28d92911a2ca Mon Sep 17 00:00:00 2001 From: dtluna Date: Wed, 27 Mar 2019 17:33:25 +0300 Subject: [PATCH] Replace process.Signal with syscall.Kill --- kill/kill.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/kill/kill.go b/kill/kill.go index d130271..126dabb 100644 --- a/kill/kill.go +++ b/kill/kill.go @@ -85,13 +85,7 @@ func main() { exitCode := 0 if len(args.PIDs) > 0 { for _, pid := range args.PIDs { - process, err := os.FindProcess(pid) - if err != nil { - common.PrintToStderr(fmt.Sprintf("error finding process %v: %v", pid, err)) - exitCode = 1 - continue - } - err = process.Signal(sig) + err := syscall.Kill(pid, sig) if err != nil { common.PrintToStderr(fmt.Sprintf("kill %v: %v", pid, err)) exitCode = 1