I'm a new in golang and i don't understand why I can't get next code working:
func ListApps(){
fmt.Printf("
Press Q to go back..
")
reader := bufio.NewReader(os.Stdin)
input, _ := reader.ReadString('
')
if string(input) == "q" {
fmt.Printf("OK")
}
}
I want to print a message, then scan user's input in console, compare input and print messafe if imput equals string "q". Last check doesn't work for some reasons.