I want to run grep on the output produced by a go program. With other languages, I can easily do it. e.g.: java Test | grep world
Even redirecting the output to a file doesn't seem to work and the file created is empty and the terminal still prints the output.
package main
func main() {
println("One")
println("Hello")
}
Expected:
go build test.go
./test | grep 'e'
Hello
Actual:
go build test.go
./test | grep 'e'
One
Hello