Skip to content

Commit 05ce150

Browse files
authored
Fix JSON output not printing newline (#1091)
1 parent df8c924 commit 05ce150

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: cli/feedback/feedback.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func (fb *Feedback) printJSON(v interface{}) {
118118
if d, err := json.MarshalIndent(v, "", " "); err != nil {
119119
fb.Errorf("Error during JSON encoding of the output: %v", err)
120120
} else {
121-
fmt.Fprint(fb.out, string(d))
121+
fmt.Fprintf(fb.out, "%v\n", string(d))
122122
}
123123
}
124124

Diff for: test/test_board.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def test_board_details(run_command):
442442
# Test board listall with and without showing hidden elements
443443
result = run_command("board listall MIPS --format json")
444444
assert result.ok
445-
assert result.stdout == "{}"
445+
assert result.stdout == "{}\n"
446446

447447
result = run_command("board listall MIPS -a --format json")
448448
assert result.ok

0 commit comments

Comments
 (0)