mirror of
https://github.com/fiatjaf/nak.git
synced 2024-11-22 16:19:07 -05:00
trim spaces from stdin.
This commit is contained in:
parent
50dde2117c
commit
c6e9fdd053
|
@ -6,6 +6,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
@ -16,7 +17,7 @@ func getStdin() string {
|
||||||
read := bytes.NewBuffer(make([]byte, 0, 1000))
|
read := bytes.NewBuffer(make([]byte, 0, 1000))
|
||||||
_, err := io.Copy(read, os.Stdin)
|
_, err := io.Copy(read, os.Stdin)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return read.String()
|
return strings.TrimSpace(read.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user