json pretty print using intent

This commit is contained in:
Wouter Groeneveld 2021-04-11 13:11:41 +02:00
parent 824c64c933
commit 0bb76043fd
3 changed files with 3 additions and 1 deletions

BIN
.DS_Store vendored

Binary file not shown.

2
.gitignore vendored
View File

@ -1,4 +1,6 @@
.DS_Store
config.json
data/*

View File

@ -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)
}