dec := import("cjson").new_decoder("<stdin>") fmt := import("fmt") i := 0 for { h := dec.decode() if !h { break } i++ } fmt.println(i)