Move code that was just for printing the Menu to different private function

This commit is contained in:
qowevisa 2024-10-19 10:35:34 +03:00
parent 6cd080fc72
commit 37b00556e7

View File

@ -208,8 +208,7 @@ func (m *Menu) handleInput(input string) {
}
}
func (m *Menu) iteration() {
m.Log.Flush()
func (m *Menu) printMenu() {
fmt.Printf("%s\n", m.Title)
m.lineCounter++
path := ""
@ -235,6 +234,11 @@ func (m *Menu) iteration() {
fmt.Printf("%s: Go back one layer\n", m.BackKey)
m.lineCounter++
}
}
func (m *Menu) iteration() {
m.Log.Flush()
m.printMenu()
stdinReader := bufio.NewReader(os.Stdin)
msg, err := stdinReader.ReadString('\n')
if err != nil {