From 113e0554aa9410c079ab11f2f8d2409f0a9dfad5 Mon Sep 17 00:00:00 2001 From: Oleg <97077423+RobotSail@users.noreply.github.com> Date: Fri, 4 Nov 2022 15:55:41 -0400 Subject: [PATCH] use os.Stdout.WriteString instead of fmt.Printf Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com> --- pkg/cmd/utils.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/utils.go b/pkg/cmd/utils.go index 2ebde18..f5cb771 100644 --- a/pkg/cmd/utils.go +++ b/pkg/cmd/utils.go @@ -135,8 +135,10 @@ func PrintOrWriteOut(r *Request) error { if err != nil { return err } - // stringOut := strings.ReplaceAll(fmOutput, "\\n", "\n") - fmt.Printf("%s\n", fmOutput) + _, err = os.Stdout.WriteString(fmOutput) + if err != nil { + return fmt.Errorf("could not write to stdout: %w", err) + } return nil }