Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 389 Bytes

README.md

File metadata and controls

26 lines (20 loc) · 389 Bytes

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