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