https://github.com/otiai10/jsonindent
Golang JSON Indent Encoder with io.Writer
https://github.com/otiai10/jsonindent
go indentation json
Last synced: 2 months ago
JSON representation
Golang JSON Indent Encoder with io.Writer
- Host: GitHub
- URL: https://github.com/otiai10/jsonindent
- Owner: otiai10
- Created: 2017-11-15T10:07:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-16T14:27:47.000Z (over 8 years ago)
- Last Synced: 2025-03-27T21:50:45.192Z (over 1 year ago)
- Topics: go, indentation, json
- Language: Go
- Homepage:
- Size: 1000 Bytes
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
JSON Indent for Go Just for Enjoying Code Golf :golf:
# You Ain't Gonna Need This
Because this is just a shorthand for [`json.Encoder.SetIndet`](https://godoc.org/encoding/json#Encoder.SetIndent).
```go
jsonindent.NewEncoder(w).Encode(v)
// is equivalent to
// encoder := json.NewEncoder(w)
// encoder.SetIndent("", "\t")
// encoder.Encode(v)
```
[](https://travis-ci.org/otiai10/jsonindent)
[](https://godoc.org/github.com/otiai10/jsonindent)