mirror of
https://gitee.com/johng/gf
synced 2026-07-03 11:51:04 +08:00
17 lines
225 B
Go
17 lines
225 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/gogf/gf/os/gproc"
|
|
)
|
|
|
|
func main() {
|
|
pid := 32556
|
|
m := gproc.NewManager()
|
|
m.AddProcess(pid)
|
|
err := m.KillAll()
|
|
fmt.Println(err)
|
|
m.WaitAll()
|
|
fmt.Printf("%d was killed\n", pid)
|
|
}
|