From a8978790ebf9bb9b54ba044138e18bde6ffea2fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Sun, 30 Jun 2024 15:03:43 -0700 Subject: [PATCH] these realistically shouldn't error anyway? and if they do, bye --- internal/prompt/prompt.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/prompt/prompt.go b/internal/prompt/prompt.go index 05423b0..41e9682 100644 --- a/internal/prompt/prompt.go +++ b/internal/prompt/prompt.go @@ -3,6 +3,7 @@ package prompt import ( "bytes" "fmt" + "log" "os" "golang.org/x/term" @@ -15,15 +16,14 @@ func YesNo(prompt string) bool { } func AskRune(prompt, options string) byte { - // TODO: handle errors better // switch stdin into 'raw' mode oldState, err := term.MakeRaw(int(os.Stdin.Fd())) if err != nil { - panic(err) + log.Fatal(err) } defer func() { if err := term.Restore(int(os.Stdin.Fd()), oldState); err != nil { - panic(err) + log.Fatal(err) } }()