summaryrefslogtreecommitdiffstats
path: root/routers/repo/issue.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-12-25 09:59:32 +0000
committerGitHub <noreply@github.com>2020-12-25 11:59:32 +0200
commita19447aed128ecadfcd938d6a80cd4951af1f4ce (patch)
tree6312bf946d601aab29731645a4777feeaea66036 /routers/repo/issue.go
parent04ae0f2f3f4556c6d0b4adc5f2cffd0cc7d25151 (diff)
downloadgitea-a19447aed128ecadfcd938d6a80cd4951af1f4ce.tar.gz
gitea-a19447aed128ecadfcd938d6a80cd4951af1f4ce.zip
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
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r--routers/repo/issue.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index f1336ac791..1d8d9c0366 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -114,7 +114,7 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
viewType := ctx.Query("type")
sortType := ctx.Query("sort")
types := []string{"all", "your_repositories", "assigned", "created_by", "mentioned"}
- if !com.IsSliceContainsStr(types, viewType) {
+ if !util.IsStringInSlice(viewType, types, true) {
viewType = "all"
}
@@ -981,7 +981,7 @@ func NewIssuePost(ctx *context.Context, form auth.CreateIssueForm) {
}
log.Trace("Issue created: %d/%d", repo.ID, issue.ID)
- ctx.Redirect(ctx.Repo.RepoLink + "/issues/" + com.ToStr(issue.Index))
+ ctx.Redirect(ctx.Repo.RepoLink + "/issues/" + fmt.Sprint(issue.Index))
}
// commentTag returns the CommentTag for a comment in/with the given repo, poster and issue
@@ -1061,10 +1061,10 @@ func ViewIssue(ctx *context.Context) {
// Make sure type and URL matches.
if ctx.Params(":type") == "issues" && issue.IsPull {
- ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + com.ToStr(issue.Index))
+ ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + fmt.Sprint(issue.Index))
return
} else if ctx.Params(":type") == "pulls" && !issue.IsPull {
- ctx.Redirect(ctx.Repo.RepoLink + "/issues/" + com.ToStr(issue.Index))
+ ctx.Redirect(ctx.Repo.RepoLink + "/issues/" + fmt.Sprint(issue.Index))
return
}
@@ -1411,7 +1411,7 @@ func ViewIssue(ctx *context.Context) {
log.Error("IsProtectedBranch: %v", err)
} else if !protected {
canDelete = true
- ctx.Data["DeleteBranchLink"] = ctx.Repo.RepoLink + "/pulls/" + com.ToStr(issue.Index) + "/cleanup"
+ ctx.Data["DeleteBranchLink"] = ctx.Repo.RepoLink + "/pulls/" + fmt.Sprint(issue.Index) + "/cleanup"
}
}
}