diff --git a/exec.go b/exec.go index 73f9f54..b9a04c2 100644 --- a/exec.go +++ b/exec.go @@ -10,7 +10,7 @@ import ( ) func run(cmd io.Reader) error { - fmt.Fprintln(Trace, cmd) + fmt.Fprintln(Trace, strings.TrimRight(fmt.Sprintf("%v", cmd), "\n")) a, ok := cmd.(Attacher) if !ok { // If this command does not implement Attacher, stream it to stdout @@ -32,7 +32,7 @@ func run(cmd io.Reader) error { } func get(cmd io.Reader) (Result, error) { - fmt.Fprintln(Trace, cmd) + fmt.Fprintln(Trace, strings.TrimRight(fmt.Sprintf("%v", cmd), "\n")) var r Result var wg errgroup.Group diff --git a/pipe.go b/pipe.go index 8557799..3cc338b 100644 --- a/pipe.go +++ b/pipe.go @@ -22,7 +22,7 @@ func pipeTrace(src io.Reader, mid []io.ReadWriter) { fmt.Fprintf(Trace, " | ") } if str, ok := e.(fmt.Stringer); ok { - fmt.Fprint(Trace, str.String()) + fmt.Fprint(Trace, strings.TrimRight(str.String(), "\n")) } else { fmt.Fprintf(Trace, "<%T>", e) } @@ -70,7 +70,7 @@ func MustPipe(src io.Reader, cmd ...io.ReadWriter) { e = cmd[i] } if str, ok := e.(fmt.Stringer); ok { - b.WriteString(str.String()) + b.WriteString(strings.TrimRight(str.String(), "\n")) } else { fmt.Fprintf(&b, "<%T>", e) } @@ -133,7 +133,7 @@ func MustGetPipe(src io.Reader, cmd ...io.ReadWriter) Result { e = cmd[i] } if str, ok := e.(fmt.Stringer); ok { - b.WriteString(str.String()) + b.WriteString(strings.TrimRight(str.String(), "\n")) } else { fmt.Fprintf(&b, "<%T>", e) }