(pid int)
| 36 | } |
| 37 | |
| 38 | func KillProcess(pid int) error { |
| 39 | if runtime.GOOS == "windows" { |
| 40 | cmd := exec.Command("taskkill", "/F", "/T", "/PID", strconv.Itoa(pid)) |
| 41 | return cmd.Run() |
| 42 | } else { |
| 43 | process, err := os.FindProcess(pid) |
| 44 | if err != nil { |
| 45 | return err |
| 46 | } |
| 47 | return process.Signal(os.Kill) |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | func TerminateProcess(pid int) error { |
| 52 | if runtime.GOOS == "windows" { |
no outgoing calls
no test coverage detected