diff --git a/commands/output.go b/commands/output.go index fc3f474..9397f09 100644 --- a/commands/output.go +++ b/commands/output.go @@ -32,6 +32,13 @@ func (c *Cmd) OutputJSON(v interface{}, prettyFlag bool) error { fmt.Fprintf(c.Out, string(jsonRaw)) + jsonStr := string(jsonRaw) + if strings.HasSuffix(jsonStr, "\n") { + fmt.Fprintf(c.Out, jsonStr) + } else { + fmt.Fprintf(c.Out, jsonStr+"\n") + } + return nil }