Restructure the code so that mainImplementation() takes stdout and stderr parameters as io.Writers, and change main() to pass os.Stdout and os.Stderr into that function. By avoiding global variables deeper in the code, this opens the way to changing the tests to run the program in-process rather than as an external binary (but that step isn't done in this PR).
/cc @tgummerer and @ttaylorr as possible reviewers.
Restructure the code so that
mainImplementation()
takesstdout
andstderr
parameters asio.Writers
, and changemain()
to passos.Stdout
andos.Stderr
into that function. By avoiding global variables deeper in the code, this opens the way to changing the tests to run the program in-process rather than as an external binary (but that step isn't done in this PR)./cc @tgummerer and @ttaylorr as possible reviewers.