The pipes between processes are the easy way to use the output of the first process as the input of other processes. The same concept could be done in Go, for example, to pipe data from one socket to another socket, to create the tunneled connection. This recipe will show you how to create the pipe with use of the Go built-in library.
Piping between writer and reader
How to do it...
- Open the console and create the folder chapter05/recipe09.
- Navigate to the directory.
- Create the pipe.go file with the following content:
package main
import (
"io"
"log"
"os"
"os/exec"
)
func main() {
pReader, pWriter := io.Pipe...