1
0
Fork 0
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:
zeripath 2021-03-01 21:08:10 +00:00 committed by GitHub
parent 59fd641d1f
commit f0e15250b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
77 changed files with 264 additions and 82 deletions

View file

@ -8,7 +8,6 @@ import (
"bufio"
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"strings"
@ -21,6 +20,7 @@ import (
"code.gitea.io/gitea/modules/notification"
"code.gitea.io/gitea/modules/setting"
issue_service "code.gitea.io/gitea/services/issue"
jsoniter "github.com/json-iterator/go"
)
// NewPullRequest creates new pull request with labels for repository.
@ -86,6 +86,7 @@ func NewPullRequest(repo *models.Repository, pull *models.Issue, labelIDs []int6
data.CommitIDs = append(data.CommitIDs, e.Value.(*git.Commit).ID.String())
}
json := jsoniter.ConfigCompatibleWithStandardLibrary
dataJSON, err := json.Marshal(data)
if err != nil {
return err