👩💻 Join our community of thousands of amazing developers!
In this post I want to discuss faking (or redirecting) standard input and output (os.Stdin and os.Stdout [1]) in Go programs. This is often done in tests, but may also be useful in other scenarios. The basic idea is demonstrated in the following pseudocode: StartFakingIO(stdin to feed …...