Package jsonpp provides tools for pretty printing JSON. jsonpp = json pretty print.
Go to file
Charles Iliya Krempeaux 1bbb9e3a50 correction 2023-10-27 11:30:35 -07:00
LICENSE initial commits 2023-09-27 13:45:27 +09:00
README.md correction 2023-10-27 11:30:35 -07:00
errors.go initial commits 2023-09-27 13:45:47 +09:00
fprettyprint.go initial commits 2023-09-27 13:45:47 +09:00
go.mod initial commits 2023-09-27 13:46:14 +09:00
go.sum initial commits 2023-09-27 13:46:14 +09:00
jsonprettyprint.go initial commits 2023-09-27 13:45:47 +09:00
prettyprint.go initial commits 2023-09-27 13:45:47 +09:00
sprettyprint.go initial commits 2023-09-27 13:45:47 +09:00

README.md

go-jsonpp

Package jsonpp provides tools for pretty printing JSON.

jsonpp = json pretty print

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/sourcecode.social/reiver/go-jsonpp

GoDoc

Example

Here is an example usage:

import "sourcecode.social/reiver/go-jsonpp"

// ...


var jsn []byte // <--- contains JSON

// ...

jsonpp.PrettyPrint(jsn) // outputs the pretty-printed JSON to the STDOUT.

Can also send it to an io.Writer

import "sourcecode.social/reiver/go-jsonpp"

// ...


var jsn []byte // <--- contains JSON

// ...

jsonpp.FPrettyPrint(writer, jsn) // outputs the pretty-printed JSON to an io.Writer.

Or return it as a string:

import "sourcecode.social/reiver/go-jsonpp"

// ...


var jsn []byte // <--- contains JSON

// ...

s := jsonpp.SPrettyPrint(jsn) // returns the pretty-printed JSON as a string.

Import

To import package jsonpp use import code like the follownig:

import "sourcecode.social/reiver/go-jsonpp"

Installation

To install package jsonpp do the following:

GOPROXY=direct go get https://sourcecode.social/reiver/go-jsonpp

Author

Package jsonpp was written by Charles Iliya Krempeaux