From f2a2d058d128cd38d3d421091dbe02bab23e2bc3 Mon Sep 17 00:00:00 2001 From: shreyas-goenka <88374338+shreyas-goenka@users.noreply.github.com> Date: Thu, 22 Jun 2023 13:47:52 +0200 Subject: [PATCH] Remove \r from new line print statments (#509) ## Changes Removes carriage character from new line prints for json output mode and sync events ## Tests Manually --- cmd/sync/output.go | 2 +- libs/cmdio/render.go | 2 +- libs/git/reference.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/sync/output.go b/cmd/sync/output.go index 57ebdbd4..2785343f 100644 --- a/cmd/sync/output.go +++ b/cmd/sync/output.go @@ -46,7 +46,7 @@ func textOutput(ctx context.Context, ch <-chan sync.Event, w io.Writer) { // Sync events produce an empty string if nothing happened. if str := e.String(); str != "" { bw.WriteString(str) - bw.WriteString("\r\n") + bw.WriteString("\n") bw.Flush() } } diff --git a/libs/cmdio/render.go b/libs/cmdio/render.go index 24dec02c..7b3da190 100644 --- a/libs/cmdio/render.go +++ b/libs/cmdio/render.go @@ -53,7 +53,7 @@ func renderJson(w io.Writer, v any) error { if err != nil { return err } - _, err = w.Write([]byte("\r\n")) + _, err = w.Write([]byte("\n")) return err } diff --git a/libs/git/reference.go b/libs/git/reference.go index 66bd5403..4021f2e6 100644 --- a/libs/git/reference.go +++ b/libs/git/reference.go @@ -38,7 +38,7 @@ func isSHA1(s string) bool { } func LoadReferenceFile(path string) (*Reference, error) { - // read referebce file content + // read reference file content b, err := os.ReadFile(path) if os.IsNotExist(err) { return nil, nil