I want to write a console application using “go” that will transfer control to another console application.
Here are the steps:
- run binary app which validates and installs a few things if necessary
- binary app constructs a command string with options
- binary app starts process B and exits (a node.js app in my case)
- Process B runs to completion and sends output to the same console.
The ONLY step I need is the ability to start a new process and exit, so that is the question here.
See Golang fork process. In short, there are issues with doing this directly. You should instead use a non-Go program to start your node.js app.