Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DummyKey is a string that GetKeyPushed() returns if set. Use this for testing. DummyKey string = "" // DummyErr is an error message that GetKeyPushed() returns if set. Use this for testing. DummyErr error = nil // UserInput is a string that GetKeyPushed() returns if set. Use this for testing. // It will override the user input. UserInput string = "" // OsExit is a copy of os.Exit to ease mock the application exit. OsExit func(code int) = os.Exit )
View Source
var DummyIsTTY bool = false
DummyIsTTY is a bool that IsTTY() returns if set. Use this for testing.
View Source
var TTYOpen func() (*tty.TTY, error) = tty.Open
TTYOpen is a copy of tty.Open() to ease testing. Override the function for testing.
Functions ¶
func GetKeyPushed ¶
GetKeyPushed returns the single key pressed by the user via tty(terminal).
It is useful to get the user input without entering `enter` key.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.