//go:build windows package forwarder import ( "errors" "golang.org/x/sys/windows" ) func processExists(pid int) bool { handle, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pid)) if err == nil { _ = windows.CloseHandle(handle) return true } return errors.Is(err, windows.ERROR_ACCESS_DENIED) }