diff options
| author | Shulhan <ms@kilabit.info> | 2023-09-09 15:38:20 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-09-09 15:38:20 +0700 |
| commit | b71b230bdb378c6fb0fedd3faf37211f11afe530 (patch) | |
| tree | 827370a35fafcb2d415f811f98d1af794ff6533c /lib/git/git.go | |
| parent | ed962926fd02987a1ba98c538e292d94a1a4894b (diff) | |
| download | pakakeh.go-b71b230bdb378c6fb0fedd3faf37211f11afe530.tar.xz | |
lib/git: replace lib/test/mock with bytes.Buffer
This changes require changing the internal type of _stdout and _stderr
from *os.File to io.Reader.
The reason of replacing lib/test/mock is to minimize read/write to file,
since mock.Stdin/Stderr is a temporary files.
Diffstat (limited to 'lib/git/git.go')
| -rw-r--r-- | lib/git/git.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/git/git.go b/lib/git/git.go index 963bdf6e..78a44e28 100644 --- a/lib/git/git.go +++ b/lib/git/git.go @@ -8,6 +8,7 @@ package git import ( "bytes" "fmt" + "io" "os" "os/exec" "path/filepath" @@ -22,8 +23,8 @@ const ( ) var ( - _stdout = os.Stdout - _stderr = os.Stderr + _stdout io.Writer = os.Stdout + _stderr io.Writer = os.Stderr ) // CheckoutRevision will set the HEAD to specific revision on specific branch. |
