Add missing error output if JSON output can't be emitted

pull/9/head
Liz Rice 7 years ago
parent 44136fa080
commit 1be52fb304

@ -112,6 +112,8 @@ func runChecks(t check.NodeType) {
if jsonFmt {
out, err := controls.JSON()
if err != nil {
fmt.Fprintf(os.Stderr, "failed to output in JSON format: %v\n", err)
os.Exit(1)
}
fmt.Println(string(out))

Loading…
Cancel
Save