mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-11-28 02:31:51 +08:00
23 lines
402 B
Go
23 lines
402 B
Go
//go:build windows
|
|
|
|
package toolguard
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
"os/exec"
|
|
"strconv"
|
|
"time"
|
|
)
|
|
|
|
func setProcessGroup(_ *exec.Cmd) {}
|
|
|
|
func killProcessGroup(p *os.Process) {
|
|
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
|
|
defer cancel()
|
|
_ = exec.CommandContext(ctx, "taskkill", "/T", "/F", "/PID", strconv.Itoa(p.Pid)).Run()
|
|
_ = p.Kill()
|
|
}
|
|
|
|
func killProcessIDs(_ []int) {}
|