如何手动关闭 exec执行的进程???

btsome · · 1095 次点击
cmd := exec.Command("curl", "-o", "go1.15.6.linux-amd64.tar.gz", "https://dl.google.com/go/go1.15.6.linux-amd64.tar.gz") cmd.SysProcAttr = &syscall.SysProcAttr{Pdeathsig: syscall.SIGKILL} err := cmd.Start() if err != nil { log.Fatalf("failed to call Run(): %v", err) } 参考: https://colobu.com/2017/06/19/advanced-command-execution-in-Go-with-os-exec/
#1