Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hokaccha/go-prettyjson
JSON pretty print for Golang.
https://github.com/hokaccha/go-prettyjson
Last synced: 7 days ago
JSON representation
JSON pretty print for Golang.
- Host: GitHub
- URL: https://github.com/hokaccha/go-prettyjson
- Owner: hokaccha
- License: mit
- Created: 2014-10-10T07:05:22.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-01-23T00:37:46.000Z (almost 2 years ago)
- Last Synced: 2024-12-14T04:05:18.314Z (14 days ago)
- Language: Go
- Size: 20.5 KB
- Stars: 136
- Watchers: 5
- Forks: 28
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# prettyjson
JSON pretty print for Golang.
## Example
```go
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](http://i.imgur.com/cUFj5os.png)
## License
MIT