fix: prompt for new input on error with ContinuePrompt

basically, dont disregard the error we get and dont return previous
input. now we try to prompt for new input without running the
previous if the function got an error
pull/61/head
sammyette 2021-06-11 18:26:34 -04:00
parent 7a8df8b9f2
commit 419e327d95
No known key found for this signature in database
GPG Key ID: 50EE40A2809851F5
1 changed files with 5 additions and 2 deletions

View File

@ -140,6 +140,7 @@ func main() {
os.Exit(0)
}
input:
for interactive {
running = false
@ -162,8 +163,10 @@ func main() {
if strings.HasSuffix(input, "\\") {
for {
input, err = ContinuePrompt(strings.TrimSuffix(input, "\\"))
if err != nil || !strings.HasSuffix(input, "\\") {
if err != nil {
goto input // continue inside nested loop
}
if !strings.HasSuffix(input, "\\") {
break
}
}