diff options
author | Unknwon <u@gogs.io> | 2018-06-09 17:32:58 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2018-06-09 17:32:58 +0800 |
commit | fbecc18e2e4d4eb863a990a57218305f190ae6db (patch) | |
tree | 11278a833eec45d8bf710f4e6e27481975b96eaa /pkg/template | |
parent | b538c5345e1271fcaf413b82ba1ece555dd635a5 (diff) |
*: use jsoniter to replace encoding/json
Diffstat (limited to 'pkg/template')
-rw-r--r-- | pkg/template/template.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/template/template.go b/pkg/template/template.go index 7d0fb676..ff9921e7 100644 --- a/pkg/template/template.go +++ b/pkg/template/template.go @@ -6,7 +6,6 @@ package template import ( "container/list" - "encoding/json" "fmt" "html/template" "mime" @@ -15,6 +14,7 @@ import ( "strings" "time" + "github.com/json-iterator/go" "github.com/microcosm-cc/bluemonday" "golang.org/x/net/html/charset" "golang.org/x/text/transform" @@ -281,8 +281,8 @@ func ActionIcon(opType int) string { func ActionContent2Commits(act Actioner) *models.PushCommits { push := models.NewPushCommits() - if err := json.Unmarshal([]byte(act.GetContent()), push); err != nil { - log.Error(4, "json.Unmarshal:\n%s\nERROR: %v", act.GetContent(), err) + if err := jsoniter.Unmarshal([]byte(act.GetContent()), push); err != nil { + log.Error(4, "Unmarshal:\n%s\nERROR: %v", act.GetContent(), err) } return push } |