I want to my app shows:
press any key to exit ...
And when I pressed any key, it exits.
How can I achieve this?
You could use this library (mine): https://github.com/eiannone/keyboard
This is an example for getting a single keystroke:
char, _, err := keyboard.GetSingleKey() if (err != nil) { panic(err) } fmt.Printf("You pressed: %q\r\n", char)