diff options
author | zeripath <art27@cantab.net> | 2021-03-01 21:08:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-01 22:08:10 +0100 |
commit | f0e15250b9e322cc7731ba026d12387c2b549a42 (patch) | |
tree | f13d46119077ba924d620ef172b91daa315bda0a /models/issue_comment.go | |
parent | 59fd641d1fb021e35aea7f9f4a1916cc11ef5c51 (diff) | |
download | gitea-f0e15250b9e322cc7731ba026d12387c2b549a42.tar.gz gitea-f0e15250b9e322cc7731ba026d12387c2b549a42.zip |
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>
Diffstat (limited to 'models/issue_comment.go')
-rw-r--r-- | models/issue_comment.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/models/issue_comment.go b/models/issue_comment.go index 6cc03ba0e8..724cf921ea 100644 --- a/models/issue_comment.go +++ b/models/issue_comment.go @@ -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 |