From dc064e8ea75dffbc7e8b8d419bc09cf660e4d6ec Mon Sep 17 00:00:00 2001 From: Ian Adam Naval Date: Tue, 16 Sep 2014 22:00:50 -0400 Subject: [PATCH] Make free standards compliant --- free/main.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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() {