go-jsonpp/jsonprettyprint.go

22 lines
279 B
Go
Raw Normal View History

2023-09-27 04:45:47 +00:00
package jsonpp
import (
"bytes"
"encoding/json"
)
const indent string = "\t"
func jsonPrettyPrint(dst *bytes.Buffer, src []byte) error {
if nil == dst {
return errInternalError
}
err := json.Indent(dst, src, "", indent)
if nil != err {
return err
}
return nil
}