diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-07-05 10:06:33 +0300 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-07-05 10:06:33 +0300 |
| commit | 2255a314aaa19948f42c19c1d459c9838fce6c23 (patch) | |
| tree | 57fd05ee3a5cd500ec7d1a2dfb5834116a6390d7 /go-src/ui/ui.go | |
| parent | 0611d5408e750de12e0092f414ce2b26b3d0423b (diff) | |
| download | ctfc-2255a314aaa19948f42c19c1d459c9838fce6c23.tar ctfc-2255a314aaa19948f42c19c1d459c9838fce6c23.tar.gz ctfc-2255a314aaa19948f42c19c1d459c9838fce6c23.zip | |
Implemented go startup, login and register windows, as well as "error" handling
Diffstat (limited to 'go-src/ui/ui.go')
| -rw-r--r-- | go-src/ui/ui.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/go-src/ui/ui.go b/go-src/ui/ui.go index b4ce7ff..2886fff 100644 --- a/go-src/ui/ui.go +++ b/go-src/ui/ui.go @@ -1,7 +1,9 @@ package ui import ( + "bufio" "fmt" + "os" "strings" "gitlab.com/Syndamia/ctfc/go-src/utils" @@ -34,6 +36,8 @@ const ( inputRune = '@' ) +var scanner = bufio.NewScanner(os.Stdin) + // Returns an error box func ErrorBox(message string) (box string) { // 2+len because message length doesn't accomodate the spaces between the left and right border @@ -111,3 +115,8 @@ func NumberedFields(messages ...string) (result string) { result = result[:len(result)-1] return } + +func GetInput() string { + scanner.Scan() + return scanner.Text() +} |
