Kunde21 / markdownfmt

Like gofmt, but for Markdown.
MIT License
55 stars 7 forks source link

main: Don't store exitCode globally #55

Closed abhinav closed 1 year ago

abhinav commented 1 year ago

This makes a minor refactor to main to avoid use of a global exit code variable.

Instead, we declare a mainCmd struct that stores global program state like exitCode.

This also allows us to change the definition of stdin, stdout, and stderr, so that tests can provide varying values.

This contains no logic changes. All changes are mechanical. Roughly: