Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
type Process struct {
Monitor Monitor
}
func (p *Process) Kill(sig os.Signal) {
pid, err := p.Monitor.Pid()
if err != nil {
log.Println(err)
return
}
fmt.Printf("forwarding %v to %v\n", sig, pid)
process, err := os.FindProcess(pid)
if err != nil {
log.Println(err)
return
}
err = process.Signal(sig)
if err != nil {
log.Println("failed to send signal ", sig, " to pid ", pid)
log.Println(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment