1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-13 21:18:21 +00:00

Migrate to use jsoniter instead of encoding/json (#14841)

* Migrate to use jsoniter

* fix tests

* update gitea.com/go-chi/binding

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
zeripath
2021-03-01 21:08:10 +00:00
committed by GitHub
parent 59fd641d1f
commit f0e15250b9
77 changed files with 264 additions and 82 deletions

View File

@@ -5,7 +5,6 @@
package events
import (
"encoding/json"
"net/http"
"time"
@@ -17,6 +16,7 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/routers/user"
jsoniter "github.com/json-iterator/go"
)
// Events listens for events
@@ -92,6 +92,7 @@ loop:
log.Error("Unable to APIFormat stopwatches: %v", err)
continue
}
json := jsoniter.ConfigCompatibleWithStandardLibrary
dataBs, err := json.Marshal(apiSWs)
if err != nil {
log.Error("Unable to marshal stopwatches: %v", err)