Skip to content

Commit 2145f35

Browse files
committed
Make feedback.Error*() add a newline to the output
The error must always be printed with a newline, otherwise the log will be appended to the output. This follows the convention set by the Arduino CLI feedback package.
1 parent e4852b1 commit 2145f35

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

result/feedback/feedback.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ func Print(message string) {
4949
}
5050
}
5151

52-
// Errorf behaves like fmt.Printf but also logs the error.
52+
// Errorf behaves like fmt.Printf but adds a newline and also logs the error.
5353
func Errorf(format string, v ...interface{}) {
5454
Error(fmt.Sprintf(format, v...))
5555
}
5656

57-
// Error behaves like fmt.Print but also logs the error.
57+
// Error behaves like fmt.Print but adds a newline and also logs the error.
5858
func Error(errorMessage string) {
59-
fmt.Fprint(os.Stderr, errorMessage)
59+
fmt.Fprintln(os.Stderr, errorMessage)
6060
logrus.Error(fmt.Sprint(errorMessage))
6161
}

0 commit comments

Comments
 (0)