mirror of
https://github.com/rwinkhart/go-boilerplate.git
synced 2026-09-01 14:47:23 -04:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ee213eeb4 | ||
|
|
cc379d407c |
+2
-1
@@ -46,6 +46,7 @@ func InputInt(prompt string, min, max int) int {
|
|||||||
if err == nil && (userInput >= min || min < 0) && (userInput <= max || max < 0) {
|
if err == nil && (userInput >= min || min < 0) && (userInput <= max || max < 0) {
|
||||||
return userInput
|
return userInput
|
||||||
}
|
}
|
||||||
|
fmt.Println()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,5 +55,5 @@ func InputMenuGen(prompt string, options []string) int {
|
|||||||
for i, option := range options {
|
for i, option := range options {
|
||||||
fmt.Printf("%d. %s\n", i+1, option)
|
fmt.Printf("%d. %s\n", i+1, option)
|
||||||
}
|
}
|
||||||
return InputInt(prompt, 1, len(options))
|
return InputInt("\n"+prompt, 1, len(options))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user