diff --git a/buildlog/buildlog.go b/buildlog/buildlog.go index d3b3424..fa71b26 100644 --- a/buildlog/buildlog.go +++ b/buildlog/buildlog.go @@ -131,7 +131,7 @@ func (l *log) output(reader *bufio.Reader) (bool, error) { return false, &parseError{} } - fmt.Fprintln(l.writer, parsedLog) + fmt.Fprintf(l.writer, "%s\r\n", parsedLog) return false, nil } diff --git a/buildlog/buildlog_test.go b/buildlog/buildlog_test.go index 1a60bd2..f803ce9 100644 --- a/buildlog/buildlog_test.go +++ b/buildlog/buildlog_test.go @@ -75,7 +75,7 @@ func TestRun(t *testing.T) { select { case <-done: - expected := "main: test 1\nmain: test 2\n" + expected := "main: test 1\r\nmain: test 2\r\n" assert.Equal(t, expected, writer.String()) case <-timeout: assert.Fail(t, "timeout stop buildlog") @@ -121,7 +121,7 @@ func TestRun(t *testing.T) { select { case <-done: - expected := "main: test 1\nmain: long input " + string(longBuffer) + "\nmain: test 3\n" + expected := "main: test 1\r\nmain: long input " + string(longBuffer) + "\r\nmain: test 3\r\n" assert.Equal(t, expected, writer.String()) case <-timeout: assert.Fail(t, "timeout stop buildlog")