From 419e327d95939180905c989f438b7a78b6f3036e Mon Sep 17 00:00:00 2001 From: sammyette <38820196+TorchedSammy@users.noreply.github.com> Date: Fri, 11 Jun 2021 18:26:34 -0400 Subject: [PATCH] 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 --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index c5acfca..2c2f9b3 100644 --- a/main.go +++ b/main.go @@ -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 } }