From c0e0e1ff4905af70a4f113eb9c2e0d94f18b2436 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 2 Dec 2024 10:38:20 +0200 Subject: return error when input can't be read --- internal/prompt/file.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/prompt/file.go b/internal/prompt/file.go index 2a23591..52143fa 100644 --- a/internal/prompt/file.go +++ b/internal/prompt/file.go @@ -29,8 +29,7 @@ func FileAction(question, content, filePath string) (string, error) { colour.Ackf("%s (y=yes/n=no/e=edit/d=delete/r=random other):", question) input, err := reader.ReadString('\n') if err != nil { - fmt.Println("Error reading input:", err) - continue + return "", fmt.Errorf("error reading input: %w", err) } switch strings.ToLower(strings.TrimSpace(input)) { -- cgit v1.2.3