From c2236e9bfd0cf30233ed495055b961f10d4bb3ae Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 9 Jul 2013 11:21:42 -0700 Subject: [PATCH] packer: Only trim whitespace on the right of prefixed UI --- packer/ui.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packer/ui.go b/packer/ui.go index 271f3a219..9d06fed93 100644 --- a/packer/ui.go +++ b/packer/ui.go @@ -10,6 +10,7 @@ import ( "os/signal" "strings" "sync" + "unicode" ) type UiColor uint @@ -110,7 +111,7 @@ func (u *PrefixedUi) prefixLines(prefix, message string) string { result.WriteString(fmt.Sprintf("%s: %s\n", prefix, line)) } - return strings.TrimSpace(result.String()) + return strings.TrimRightFunc(result.String(), unicode.IsSpace) } func (rw *ReaderWriterUi) Ask(query string) (string, error) {