From 0f66418788c708da0f13915ac6e0b83c81d5c256 Mon Sep 17 00:00:00 2001 From: Joop Kiefte Date: Thu, 28 Sep 2023 01:39:01 +0100 Subject: Correct reset loop semantics --- main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index a934a22..3432a3b 100644 --- a/main.go +++ b/main.go @@ -45,8 +45,6 @@ Running debby with any other arguments will run it as a dolt command.` fmt.Println(str) return } - } else { - choice = 0 } // Menu loop. 1. Read tale names 2. Run query 3. Run and save query 4. Execute Dolt command 5. Exit @@ -88,6 +86,8 @@ Running debby with any other arguments will run it as a dolt command.` // Exit return default: + // Reset choice + choice = 0 // Print menu fmt.Println("1. Read table names") fmt.Println("2. Run query") @@ -98,7 +98,6 @@ Running debby with any other arguments will run it as a dolt command.` // Read user input fmt.Scanln(&choice) - fmt.Println("Invalid choice") } // Reset all variables except choice -- cgit v1.2.3-70-g09d2