From cddd3d69c48b26acbe7a10baeafc023b1c2f1fc0 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Fri, 18 Oct 2024 13:26:51 -0700 Subject: [PATCH] Fix error check bug --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 6f9339f..da7751d 100644 --- a/main.go +++ b/main.go @@ -67,8 +67,11 @@ func initialModel(fullscreen bool, colorLeft string, colorRight string) model { } validateInt := func(text string) error { - _, err := strconv.Atoi(text) - return fmt.Errorf("invalid int input: %w", err) + if _, err := strconv.Atoi(text); err != nil { + return fmt.Errorf("invalid int input: %w", err) + } + + return nil } inputs[0].Placeholder = "Interval length (minutes or duration)"