github / git-sizer

Compute various size metrics for a Git repository, flagging those that might cause problems
MIT License
3.48k stars 139 forks source link

Don't write directly to `os.Stdout` and `os.Stderr` #93

Closed mhagger closed 2 years ago

mhagger commented 2 years ago

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.