I want to build a Grunt task that spawns a Go server and then kills and respawns it when the Go source files change.
I am spawning the Go process like this:
goProcess = child_process.exec('go run main.go', ...
Later I'm trying to kill the process like this:
if (goProcess) {
goProcess.kill('SIGINT');
}
But the Go process doesn't die.
How can I properly kill the Go process within Node?
I have a working example here https://github.com/sporto/go-must-die