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:
parent
f0b14af0f3
commit
c21cbc5021
@ -34,6 +34,7 @@ func printJSON(resp interface{}) {
|
||||
|
||||
var out bytes.Buffer
|
||||
json.Indent(&out, b, "", "\t")
|
||||
out.WriteString("\n")
|
||||
out.WriteTo(os.Stdout)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user