This is an example. To run it simply do go build -o slave slave.go && go build -o main main.go && ./main
Then you can try typing say
for slave process to produce output or exit
for slave process to exit.
There is an issue when slave exits main process still alive and starts burning through CPU cycles.
But I am lazy to fix that, feel free to do that.