chore(go): inject stdin and pass rc force explicitly
This commit is contained in:
@@ -8,10 +8,11 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
exitCode := run(os.Args[1:], os.Stdout, os.Stderr)
|
||||
_ = os.Setenv("GIT_TERMINAL_PROMPT", "0")
|
||||
exitCode := run(os.Args[1:], os.Stdin, os.Stdout, os.Stderr)
|
||||
os.Exit(exitCode)
|
||||
}
|
||||
|
||||
func run(args []string, stdout io.Writer, stderr io.Writer) int {
|
||||
return cli.Run(args, stdout, stderr)
|
||||
func run(args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) int {
|
||||
return cli.Run(args, stdin, stdout, stderr)
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ func TestRunVersionCommand(t *testing.T) {
|
||||
stdout := &bytes.Buffer{}
|
||||
stderr := &bytes.Buffer{}
|
||||
|
||||
exitCode := run([]string{"version"}, stdout, stderr)
|
||||
exitCode := run([]string{"version"}, bytes.NewBuffer(nil), stdout, stderr)
|
||||
if exitCode != 0 {
|
||||
t.Fatalf("run(version) exit code = %d, want 0", exitCode)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user