Skip to content

Commit

Permalink
fix: use faster JSON for responses
Browse files Browse the repository at this point in the history
  • Loading branch information
noxecane committed Nov 21, 2023
1 parent 3d54782 commit 7666e4c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package api

import (
"bytes"
"encoding/json"
jsonslow "encoding/json"
"net/http"
"strings"

"github.com/noxecane/anansi/json"
"github.com/noxecane/anansi/responses"
"github.com/rs/zerolog"
)
Expand Down Expand Up @@ -47,7 +48,7 @@ func getJSON(log *zerolog.Logger, v interface{}) []byte {
log.UpdateContext(func(ctx zerolog.Context) zerolog.Context {
buffer := new(bytes.Buffer)

if err := json.Compact(buffer, raw); err != nil {
if err := jsonslow.Compact(buffer, raw); err != nil {
panic(err)
}

Expand Down

0 comments on commit 7666e4c

Please sign in to comment.