summaryrefslogtreecommitdiffstats
path: root/routers/api
diff options
context:
space:
mode:
authorSandro Santilli <strk@kbt.io>2016-11-07 16:37:32 +0100
committerSandro Santilli <strk@kbt.io>2016-11-07 17:05:08 +0100
commit80eea77953ab5f1f12e1a01f1930b72c360a5c76 (patch)
treeef36958df6ecdf84f37a9f5c9680f591ba5cc25c /routers/api
parent5d430c9e68f7e50e6d1727c43518e84579fd6a4f (diff)
downloadgitea-80eea77953ab5f1f12e1a01f1930b72c360a5c76.tar.gz
gitea-80eea77953ab5f1f12e1a01f1930b72c360a5c76.zip
Use MixedCase constant names
See https://github.com/golang/go/wiki/CodeReviewComments#mixed-caps
Diffstat (limited to 'routers/api')
-rw-r--r--routers/api/v1/repo/hook.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/api/v1/repo/hook.go b/routers/api/v1/repo/hook.go
index 3d0bb80a7c..32fe411556 100644
--- a/routers/api/v1/repo/hook.go
+++ b/routers/api/v1/repo/hook.go
@@ -59,9 +59,9 @@ func CreateHook(ctx *context.APIContext, form api.CreateHookOption) {
HookEvent: &models.HookEvent{
ChooseEvents: true,
HookEvents: models.HookEvents{
- Create: com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_CREATE)),
- Push: com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_PUSH)),
- PullRequest: com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_PULL_REQUEST)),
+ Create: com.IsSliceContainsStr(form.Events, string(models.HookEventCreate)),
+ Push: com.IsSliceContainsStr(form.Events, string(models.HookEventPush)),
+ PullRequest: com.IsSliceContainsStr(form.Events, string(models.HookEventPullRequest)),
},
},
IsActive: form.Active,
@@ -145,9 +145,9 @@ func EditHook(ctx *context.APIContext, form api.EditHookOption) {
w.PushOnly = false
w.SendEverything = false
w.ChooseEvents = true
- w.Create = com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_CREATE))
- w.Push = com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_PUSH))
- w.PullRequest = com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_PULL_REQUEST))
+ w.Create = com.IsSliceContainsStr(form.Events, string(models.HookEventCreate))
+ w.Push = com.IsSliceContainsStr(form.Events, string(models.HookEventPush))
+ w.PullRequest = com.IsSliceContainsStr(form.Events, string(models.HookEventPullRequest))
if err = w.UpdateEvent(); err != nil {
ctx.Error(500, "UpdateEvent", err)
return