From a538cea82971f8d1cd4726ee4ad20e1317fa03f4 Mon Sep 17 00:00:00 2001 From: JackWen Date: Mon, 31 Aug 2020 14:16:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Emac=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E4=B8=8B=E7=9A=84node=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- node/node_mac.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 node/node_mac.go diff --git a/node/node_mac.go b/node/node_mac.go new file mode 100644 index 0000000..a616063 --- /dev/null +++ b/node/node_mac.go @@ -0,0 +1,17 @@ +// +build darwin + +package node + +import ( + "fmt" + "syscall" +) + +func KillProcess(processId int){ + err := syscall.Kill(processId,syscall.Signal(10)) + if err != nil { + fmt.Printf("kill processid %d is fail:%+v.\n",processId,err) + }else{ + fmt.Printf("kill processid %d is successful.\n",processId) + } +}