mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 13:18:01 +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)
|
|
}
|