I'm trying to check if an input is blank and ask for input again using a for loop, but the program is just repeatedly going over the loop without stopping to wait for input and outputting the print statement within it 100 times, what am I doing wrong?
var input string
for len(input) == 0 {
fmt.Println("What would you like to write in the journal?")
input = usr.GetInput()
}
GetInput uses bufio.NewScanner and returns scanner.Text, but even when I try Scanln, the error still occurs.
Edit:
As requested here is GetInput
func GetInput() string {
scanner := bufio.NewScanner(os.Stdin)
return scanner.Text()
}