1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-19 00:38:36 +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,12 +5,12 @@
package private
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"code.gitea.io/gitea/modules/setting"
jsoniter "github.com/json-iterator/go"
)
// Email structure holds a data for sending general emails
@@ -32,6 +32,7 @@ func SendEmail(subject, message string, to []string) (int, string) {
req := newInternalRequest(reqURL, "POST")
req = req.Header("Content-Type", "application/json")
json := jsoniter.ConfigCompatibleWithStandardLibrary
jsonBytes, _ := json.Marshal(Email{
Subject: subject,
Message: message,