diff options
author | Julien Dessaux | 2021-11-17 10:13:06 +0100 |
---|---|---|
committer | Julien Dessaux | 2021-11-17 10:13:06 +0100 |
commit | c3263c03776401ad1263a9fb8f5a44a8ed44d61b (patch) | |
tree | 7dac91753cb4428ede2ba72fb09eca9ba6c2daab /client/input.go | |
parent | Updated dependencies (diff) | |
download | shell-game-launcher-c3263c03776401ad1263a9fb8f5a44a8ed44d61b.tar.gz shell-game-launcher-c3263c03776401ad1263a9fb8f5a44a8ed44d61b.tar.bz2 shell-game-launcher-c3263c03776401ad1263a9fb8f5a44a8ed44d61b.zip |
Refactored package structure
Diffstat (limited to 'client/input.go')
-rw-r--r-- | client/input.go | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/client/input.go b/client/input.go deleted file mode 100644 index 8c814a6..0000000 --- a/client/input.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -import ( - "bufio" - "os" - - "github.com/pkg/errors" -) - -// getValidInput returns the selected menu command as a string or an error -func (s *State) getValidInput() (string, error) { - menu := s.config.Menus[s.currentMenu] - - reader := bufio.NewReader(os.Stdin) - for { - input, err := reader.ReadByte() - if err != nil { - return "", errors.Wrapf(err, "Could not read byte from stdin") - } - for _, menuEntry := range menu.MenuEntries { - if []byte(menuEntry.Key)[0] == input { - return menuEntry.Action, nil - } - } - } -} |