diff options
author | Sandro Santilli <strk@kbt.io> | 2016-11-07 16:37:32 +0100 |
---|---|---|
committer | Sandro Santilli <strk@kbt.io> | 2016-11-07 17:05:08 +0100 |
commit | 80eea77953ab5f1f12e1a01f1930b72c360a5c76 (patch) | |
tree | ef36958df6ecdf84f37a9f5c9680f591ba5cc25c /routers | |
parent | 5d430c9e68f7e50e6d1727c43518e84579fd6a4f (diff) | |
download | gitea-80eea77953ab5f1f12e1a01f1930b72c360a5c76.tar.gz gitea-80eea77953ab5f1f12e1a01f1930b72c360a5c76.zip |
Use MixedCase constant names
See https://github.com/golang/go/wiki/CodeReviewComments#mixed-caps
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/repo/hook.go | 12 | ||||
-rw-r--r-- | routers/repo/pull.go | 2 | ||||
-rw-r--r-- | routers/repo/webhook.go | 2 |
3 files changed, 8 insertions, 8 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 diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 0fdffad2db..1a5b1dd9e8 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -687,7 +687,7 @@ func CompareAndPullRequestPost(ctx *context.Context, form auth.CreateIssueForm) HeadRepo: headRepo, BaseRepo: repo, MergeBase: prInfo.MergeBase, - Type: models.PULL_REQUEST_GITEA, + Type: models.PullRequestGitea, } // FIXME: check error in the case two people send pull request at almost same time, give nice error prompt // instead of 500. diff --git a/routers/repo/webhook.go b/routers/repo/webhook.go index 3cb6d1d27e..c9d15bef08 100644 --- a/routers/repo/webhook.go +++ b/routers/repo/webhook.go @@ -383,7 +383,7 @@ func TestWebhook(ctx *context.Context) { Pusher: apiUser, Sender: apiUser, } - if err := models.PrepareWebhooks(ctx.Repo.Repository, models.HOOK_EVENT_PUSH, p); err != nil { + if err := models.PrepareWebhooks(ctx.Repo.Repository, models.HookEventPush, p); err != nil { ctx.Flash.Error("PrepareWebhooks: " + err.Error()) ctx.Status(500) } else { |