Skip to content

Commit

Permalink
fix: no pretty print output
Browse files Browse the repository at this point in the history
  • Loading branch information
bcho committed Oct 1, 2023
1 parent 32a136e commit a43e30b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,9 @@ func (server *dbServer) responseData(w http.ResponseWriter, data interface{}, st
w.WriteHeader(statusCode)

enc := json.NewEncoder(w)
enc.SetIndent("", " ")
if encodeErr := enc.Encode(data); encodeErr != nil {
server.logger.Error(encodeErr, "failed to write response")
w.WriteHeader(http.StatusCreated)
w.WriteHeader(http.StatusInternalServerError)
return
}
}
Expand Down

0 comments on commit a43e30b

Please sign in to comment.