A fork of the official Go library that allows streaming indented output.
-
Replace
import "encoding/json"
withimport "github.com/klauspost/json"
. -
Replace
err = encoder.Encode(&entry)
witherr = encoder.EncodeIndent(&entry, "", " ")
where you want your JSON to be indented.