Mainflux.mainflux/vendor/github.com/hokaccha/go-prettyjson
Manuel Imperiale 5f6bbf4b0a MF-419 - Use JSON for CLI commands output (#504)
* MF-419 - Use JSON for CLI commands output

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* dep ensure

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Remove accidentaly added CLI binary

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix cast

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix review

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Typo fix

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Use logCreated for token command

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Fix review

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-16 14:01:37 -05: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 MF-419 - Use JSON for CLI commands output (#504) 2018-12-16 14:01:37 -05:00
prettyjson.go MF-419 - Use JSON for CLI commands output (#504) 2018-12-16 14:01:37 -05:00

README.md

prettyjson

JSON pretty print for Golang.

Example

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