forked from wgroeneveld/go-jamming
json pretty print using intent
This commit is contained in:
parent
824c64c933
commit
0bb76043fd
|
@ -1,4 +1,6 @@
|
|||
|
||||
.DS_Store
|
||||
|
||||
config.json
|
||||
|
||||
data/*
|
||||
|
|
|
@ -17,7 +17,7 @@ func Unauthorized(w http.ResponseWriter) {
|
|||
|
||||
func Json(w http.ResponseWriter, data interface{}) {
|
||||
w.WriteHeader(200)
|
||||
bytes, _ := json.Marshal(data)
|
||||
bytes, _ := json.MarshalIndent(data, "", " ")
|
||||
w.Write(bytes)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue