From 028632de277704fe4576e732d4997daa70f25f60 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Wed, 15 Jun 2022 00:08:39 +0530 Subject: added color coding and error handling + other visual appeal --- ui/input.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ui/input.go') diff --git a/ui/input.go b/ui/input.go index bd7306b..0aa2f06 100644 --- a/ui/input.go +++ b/ui/input.go @@ -20,7 +20,8 @@ package ui import ( "errors" - "log" + "fmt" + "os" p "github.com/manifoldco/promptui" ) @@ -39,7 +40,8 @@ func TextInput(label, errMessage string) string { res, err := prompt.Run() if err != nil { - log.Fatal("Failed to run TextInput Prompt.") + fmt.Println("Failed to run TextInput Prompt.", err.Error()) + os.Exit(1) } return res -- cgit v1.2.3