cmd/lncli: append a new-line when using encoding/json to print resp

It was noticed by 21E14 on Github that when we fall back to using
golang’s encoding/json lib in special cases when printing the proto
responses in JSON form, the value printed lacked a new-line at the end.
This would cause the output to flow into bash prompts.

This issue has been fixed by simply appending a newline character to
the end of the formatted JSON output.

Fixes #160.
This commit is contained in:
Olaoluwa Osuntokun 2017-03-16 12:06:12 -07:00
parent f0b14af0f3
commit c21cbc5021
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -34,6 +34,7 @@ func printJSON(resp interface{}) {
var out bytes.Buffer
json.Indent(&out, b, "", "\t")
out.WriteString("\n")
out.WriteTo(os.Stdout)
}