From c6e9fdd053339beba10ff1b8615a9fd63c1ec943 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 23 Oct 2023 08:04:28 -0300 Subject: [PATCH] trim spaces from stdin. --- helpers.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helpers.go b/helpers.go index d319ede..67805bb 100644 --- a/helpers.go +++ b/helpers.go @@ -6,6 +6,7 @@ import ( "io" "net/url" "os" + "strings" "github.com/urfave/cli/v2" ) @@ -16,7 +17,7 @@ func getStdin() string { read := bytes.NewBuffer(make([]byte, 0, 1000)) _, err := io.Copy(read, os.Stdin) if err == nil { - return read.String() + return strings.TrimSpace(read.String()) } } return ""