An open API service indexing awesome lists of open source software.

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

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)
```

[![Build Status](https://travis-ci.org/otiai10/jsonindent.svg?branch=master)](https://travis-ci.org/otiai10/jsonindent)
[![GoDoc](https://godoc.org/github.com/otiai10/jsonindent?status.svg)](https://godoc.org/github.com/otiai10/jsonindent)