forked from forgejo/forgejo
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:
parent
59fd641d1f
commit
f0e15250b9
77 changed files with 264 additions and 82 deletions
|
@ -8,7 +8,6 @@ package models
|
|||
|
||||
import (
|
||||
"container/list"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strconv"
|
||||
|
@ -21,6 +20,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/references"
|
||||
"code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
|
||||
"xorm.io/builder"
|
||||
"xorm.io/xorm"
|
||||
|
@ -655,6 +655,7 @@ func (c *Comment) LoadPushCommits() (err error) {
|
|||
|
||||
var data PushActionContent
|
||||
|
||||
json := jsoniter.ConfigCompatibleWithStandardLibrary
|
||||
err = json.Unmarshal([]byte(c.Content), &data)
|
||||
if err != nil {
|
||||
return
|
||||
|
@ -1241,6 +1242,8 @@ func CreatePushPullComment(pusher *User, pr *PullRequest, oldCommitID, newCommit
|
|||
}
|
||||
|
||||
ops.Issue = pr.Issue
|
||||
|
||||
json := jsoniter.ConfigCompatibleWithStandardLibrary
|
||||
dataJSON, err := json.Marshal(data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue