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 /routes/api/v1/repo/hook.go | |
parent | b538c5345e1271fcaf413b82ba1ece555dd635a5 (diff) |
*: use jsoniter to replace encoding/json
Diffstat (limited to 'routes/api/v1/repo/hook.go')
-rw-r--r-- | routes/api/v1/repo/hook.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/routes/api/v1/repo/hook.go b/routes/api/v1/repo/hook.go index fb67bf45..98ccb41d 100644 --- a/routes/api/v1/repo/hook.go +++ b/routes/api/v1/repo/hook.go @@ -5,9 +5,8 @@ package repo import ( - "encoding/json" - "github.com/Unknwon/com" + "github.com/json-iterator/go" api "github.com/gogs/go-gogs-client" @@ -79,7 +78,7 @@ func CreateHook(c *context.APIContext, form api.CreateHookOption) { c.Error(422, "", "Missing config option: channel") return } - meta, err := json.Marshal(&models.SlackMeta{ + meta, err := jsoniter.Marshal(&models.SlackMeta{ Channel: channel, Username: form.Config["username"], IconURL: form.Config["icon_url"], @@ -129,7 +128,7 @@ func EditHook(c *context.APIContext, form api.EditHookOption) { if w.HookTaskType == models.SLACK { if channel, ok := form.Config["channel"]; ok { - meta, err := json.Marshal(&models.SlackMeta{ + meta, err := jsoniter.Marshal(&models.SlackMeta{ Channel: channel, Username: form.Config["username"], IconURL: form.Config["icon_url"], |