cf test does not capture the output when using buffered writer in Go. I use the following template for most of my code, is there a work around so I can continue using buffered io (for speed reasons) or do I switch to writing directly to standard input/output with fmt.Printf or something similar.
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
in := bufio.NewReader(os.Stdin)
out := bufio.NewWriter(os.Stdout)
defer out.Flush()
var T int
fmt.Fscan(in, &T)
for t := 0; t < T; t++ {
// logic goes here
}
}
cf test
does not capture the output when using buffered writer in Go. I use the following template for most of my code, is there a work around so I can continue using buffered io (for speed reasons) or do I switch to writing directly to standard input/output with fmt.Printf or something similar.