don't marshal with indents
save us some bandwidth
@@ -155,7 +155,7 @@ var _ = log.String
{{.BaseStringToTypeCode}}
func jsonMarshalNoError(i interface{}) string {
- bytes, err := json.MarshalIndent(i, "", "\t")
+ bytes, err := json.Marshal(i)
if err != nil {
// This should never happen
return ""
@@ -378,7 +378,7 @@ func (h handler) {{.Op}}Handler(ctx context.Context, w http.ResponseWriter, r *h
jsonSpan, _ := opentracing.StartSpanFromContext(ctx, "json-response-marshaling")
defer jsonSpan.Finish()
- respBytes, err := json.MarshalIndent(resp, "", "\t")
+ respBytes, err := json.Marshal(resp)
if err != nil {
logger.FromContext(ctx).AddContext("error", err.Error())
http.Error(w, jsonMarshalNoError({{index .StatusCodeToType 500}}{Message: err.Error()}), http.StatusInternalServerError)
