Does anyone know of a simple way to pretty-print JSON output in Go?
The stock http://golang.org/pkg/encoding/json/ package does not seem to include functiona
For better memory usage, I guess this is better:
var out io.Writer enc := json.NewEncoder(out) enc.SetIndent("", " ") if err := enc.Encode(data); err != nil { panic(err) }