From 72339bdcf71b659846c978d14ce76dda8235ec73 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Tue, 13 Aug 2019 13:08:37 -0400 Subject: trim trailing newline from passwords --- template.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3