packagepluginimport("time")// pidAlive checks whether a pid is alive.funcpidAlive(pidint)bool{return_pidAlive(pid)}// pidWait blocks for a process to exit.funcpidWait(pidint)error{ticker:=time.NewTicker(1*time.Second)deferticker.Stop()forrangeticker.C{if!pidAlive(pid){break}}returnnil}