aboutsummaryrefslogtreecommitdiffstats
path: root/input/prompt.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-02-15 15:58:31 +0100
committerMichael Muré <batolettre@gmail.com>2020-02-15 15:58:31 +0100
commita4e5035b99889c571abce1a836887434d73cd03e (patch)
treeaa1d2f6be7762e774ac7dbf1ac68670b8942d66f /input/prompt.go
parent157e10f2e1d49748f62e210cadc088ecae9f3dfc (diff)
downloadgit-bug-a4e5035b99889c571abce1a836887434d73cd03e.tar.gz
prompt: minor fixes
Diffstat (limited to 'input/prompt.go')
-rw-r--r--input/prompt.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/input/prompt.go b/input/prompt.go
index b5ca9a17..bd3fe4f0 100644
--- a/input/prompt.go
+++ b/input/prompt.go
@@ -145,7 +145,7 @@ func PromptChoice(prompt string, choices []string) (int, error) {
index, err := strconv.Atoi(line)
if err != nil || index < 1 || index > len(choices) {
- _, _ = fmt.Fprintf(os.Stderr, "invalid input")
+ _, _ = fmt.Fprintln(os.Stderr, "invalid input")
continue
}
@@ -179,7 +179,7 @@ func PromptURLWithRemote(prompt, name string, validRemotes []string, validators
index, err := strconv.Atoi(line)
if err != nil || index < 0 || index > len(validRemotes) {
- _, _ = fmt.Fprintf(os.Stderr, "invalid input")
+ _, _ = fmt.Fprintln(os.Stderr, "invalid input")
continue
}
@@ -249,7 +249,7 @@ func PromptCredential(target, name string, credentials []auth.Credential, choice
}
switch {
- case index < len(choices):
+ case index <= len(choices):
return nil, index - 1, nil
default:
return credentials[index-len(choices)-1], 0, nil