I am very new to Golang and so might be doing something totally stupid
here. My goal is to start two processes (java -jar someJar.jar) and then to
manage communication between them. The problem is that I cannot even get
started with single process and cannot seem to find something that works
for my case. Here is some code sceleton:
func main() {
consumer := exec.Command("java", "jar", "C:\\jars\\target\\my-jar.jar --a")
consumerIn, err := consumer.StdinPipe()
handleError(err)
consumerOut, err := consumer.StdoutPipe()
handleError(err)
// Start
err = consumer.Start()
handleError(err)
consumerRead := bufio.NewReader(consumerOut)
handleError(err)
line, _, err := consumerRead.ReadLine()
handleError(err)* // Error: EOF*
fmt.Println(line)
consumerIn.Write([]byte("bnbban"))
line, _, err = consumerRead.ReadLine()
fmt.Println(line)
}
Basically I am not sure if anything works here, since nothing indicates
that this is.
So just looking for some guidelines, not necessary full solution, but just
how to work with processes basically tail their output and communicate
between them.
Sorry for such non-constructive post, just that I am somewhat confused and
not sure how to specify it in more structural way.
Thanks.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.