I am trying to see if Go is capable of performing logic on user input as it is typed instead of waiting for a carriage return to begin processing. I utilized NCurses to accomplish this with a small Python game but wasn't sure how to get NCurses functioning with Go.
Right now, I'm using
reader := bufio.NewReader(os.Stdin)
fmt.Print("Select: ")
text, _ := reader.ReadString('
')
text = strings.Trim(text, "
")
but as I said, this does not process until the user hits enter.
I would like to perform a check on whatever the user entered and eliminate the need for a carriage return; hitting one button is sufficient to generate a response.