Mainflux.mainflux/vendor/github.com/hokaccha/go-prettyjson
Dušan Borovčanin d86a4dee92
Update dependencies (#1545)
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
2022-01-18 15:28:46 +01:00
..
.gitignore MF-419 - Use JSON for CLI commands output (#504) 2018-12-16 14:01:37 -05:00
LICENSE MF-419 - Use JSON for CLI commands output (#504) 2018-12-16 14:01:37 -05:00
README.md Update dependencies (#1545) 2022-01-18 15:28:46 +01:00
prettyjson.go MF-1378 - Update dependencies (#1379) 2021-05-20 20:53:56 +02:00

README.md

prettyjson

JSON pretty print for Golang.

Example

import "github.com/hokaccha/go-prettyjson"

v := map[string]interface{}{
    "str": "foo",
    "num": 100,
    "bool": false,
    "null": nil,
    "array": []string{"foo", "bar", "baz"},
    "map": map[string]interface{}{
        "foo": "bar",
    },
}
s, _ := prettyjson.Marshal(v)
fmt.Println(string(s))

Output

License

MIT