From 88550fec5a03719ebdea681c1095263a18f6676c Mon Sep 17 00:00:00 2001 From: kgoins Date: Tue, 19 Jan 2021 16:40:41 -0500 Subject: [PATCH] modded getString to trim leading/trailing whitespace since it isn't valid input for any of the prompted fields but is accepted by the function --- cmd/cmdbuilder.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/cmdbuilder.go b/cmd/cmdbuilder.go index 8d25a8d..43e15f1 100644 --- a/cmd/cmdbuilder.go +++ b/cmd/cmdbuilder.go @@ -4,6 +4,7 @@ import ( "bufio" "fmt" "os" + "strings" "github.com/kgoins/ldsview/internal" "github.com/spf13/cobra" @@ -47,5 +48,7 @@ func getString() (output string) { if scanner.Scan() { output = scanner.Text() } + + output = strings.TrimSpace(output) return }