diff options
author | Ben Burwell <ben@benburwell.com> | 2019-08-13 13:08:37 -0400 |
---|---|---|
committer | Ben Burwell <ben@benburwell.com> | 2019-08-13 13:08:37 -0400 |
commit | 72339bdcf71b659846c978d14ce76dda8235ec73 (patch) | |
tree | d346cfac038230c20c9dbd8c0c9979be1823b353 | |
parent | 2fde66440ea282532bb1a8e0380e32d331302e39 (diff) |
trim trailing newline from passwords
-rw-r--r-- | template.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/template.go b/template.go index cb6dc2e..cb815a3 100644 --- a/template.go +++ b/template.go @@ -5,6 +5,7 @@ import ( "os" "os/exec" "path/filepath" + "strings" "text/template" "github.com/BurntSushi/toml" @@ -32,7 +33,7 @@ func lookupPassword(name string) (string, error) { if err != nil { return "", err } - return string(line), nil + return strings.TrimRight(string(line), "\n"), nil } func getTemplateData() (*TemplateData, error) { |