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

Use the new `pipe` package for running external commands #91

Closed mhagger closed 2 years ago

mhagger commented 2 years ago

The existing code wasn't always checking errors and freeing resources correctly. It's quite difficult, especially to handle all error paths correctly.

So instead of "handcrafting" command pipelines using low-level facilities like exec.Cmd, switch to using the pipe package that was introduced in #90. That package takes care of most of the details internally, presenting a more convenient and less error-prone UI.

This change clears up a bunch of linter errors regarding unchecked errors.

Note that this PR branch is built on top of the changes that were added in PRs #89 and #90. Those PRs can be merged separately or in combination with this one.

/cc @tgummerer and @ttaylorr as possible reviewers