summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-12-02 10:38:20 +0200
committerPaul Buetow <paul@buetow.org>2024-12-02 10:38:20 +0200
commitc0e0e1ff4905af70a4f113eb9c2e0d94f18b2436 (patch)
tree627d4c8dd3cd0bded03f0ed22a85670a3d2410ec
parent06a615903d8cd18b50003df138baf2938c6585bd (diff)
return error when input can't be read
-rw-r--r--internal/prompt/file.go3
1 files changed, 1 insertions, 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)) {