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