diff --git a/free/main.go b/free/main.go index 66c3e47..0849aef 100644 --- a/free/main.go +++ b/free/main.go @@ -74,13 +74,20 @@ func parseMemInfo() jsh.JshFrame { memInfo[key] = val } - finalOut := jsh.JshFrame{memInfo, errors} + // Wrap with array + stdOut := []map[string]jsh.MemStat{memInfo} + finalOut := jsh.JshFrame{stdOut, errors} return finalOut } func runJsonMode() { output := parseMemInfo() - fmt.Println("%s", *output.ToJson()) + queue := make(chan *jsh.JshFrame) + done := make(chan bool) + go jsh.OutputFrames(queue, done) + queue <- &output + close(queue) + <-done } func main() {