1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 10:18:38 +00:00

migrate from com.* to alternatives (#14103)

* remove github.com/unknwon/com from models

* dont use "com.ToStr()"

* replace "com.ToStr" with "fmt.Sprint" where its easy to do

* more refactor

* fix test

* just "proxy" Copy func for now

* as per @lunny
This commit is contained in:
6543
2020-12-25 09:59:32 +00:00
committed by GitHub
parent 04ae0f2f3f
commit a19447aed1
46 changed files with 230 additions and 220 deletions

View File

@@ -20,9 +20,8 @@ import (
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/services/webhook"
"github.com/unknwon/com"
)
const (
@@ -100,7 +99,7 @@ func getOrgRepoCtx(ctx *context.Context) (*orgRepoCtx, error) {
func checkHookType(ctx *context.Context) string {
hookType := strings.ToLower(ctx.Params(":type"))
if !com.IsSliceContainsStr(setting.Webhook.Types, hookType) {
if !util.IsStringInSlice(hookType, setting.Webhook.Types, true) {
ctx.NotFound("checkHookType", nil)
return ""
}