packer: Only trim whitespace on the right of prefixed UI

This commit is contained in:
Mitchell Hashimoto 2013-07-09 11:21:42 -07:00
parent 074d2bf937
commit c2236e9bfd
1 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import (
"os/signal" "os/signal"
"strings" "strings"
"sync" "sync"
"unicode"
) )
type UiColor uint type UiColor uint
@ -110,7 +111,7 @@ func (u *PrefixedUi) prefixLines(prefix, message string) string {
result.WriteString(fmt.Sprintf("%s: %s\n", prefix, line)) 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) { func (rw *ReaderWriterUi) Ask(query string) (string, error) {