chore(go): inject stdin and pass rc force explicitly

This commit is contained in:
Micheal Wilkinson
2026-03-21 20:45:05 +00:00
parent 038b109e7b
commit d642870a66
7 changed files with 66 additions and 66 deletions

View File

@@ -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)
}

View File

@@ -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)
}