aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoop Kiefte <ikojba@gmail.com>2023-09-28 01:39:01 +0100
committerJoop Kiefte <ikojba@gmail.com>2023-09-28 01:39:01 +0100
commit0f66418788c708da0f13915ac6e0b83c81d5c256 (patch)
treec3e4705445cace461abf3c1280a70741767a76ee
parent9541cf3832bc32bdc120a6412657cff99243d1f1 (diff)
Correct reset loop semantics
-rw-r--r--main.go5
1 files 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