If I have the PID of a process, is os.FindProcess enough to test for the existing of the process? I mean if it returns err
can I assume that it\'s terminated (o
On Windows checking the result of os.FindProcess()
seems to be enough to check if process is running.
func isProcessRunning(pid int) bool {
_, err = os.FindProcess(pid)
if err != nil {
return false
}
if runtime.GOOS == "windows" {
return true
}
return false // further checking for other systems then Windows is not supported here
}