summaryrefslogtreecommitdiffstats
path: root/routers/web/repo/pull.go
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-07-05 05:41:32 +0200
committerGitHub <noreply@github.com>2023-07-04 23:41:32 -0400
commit24e64fe37225a315c74c00d1f5e4d024168feea6 (patch)
treec89664dca5a884d5fc0a322815ce3bc20247cf84 /routers/web/repo/pull.go
parent4e310133f95ba8581c121a32596807721bdd6af9 (diff)
downloadgitea-24e64fe37225a315c74c00d1f5e4d024168feea6.tar.gz
gitea-24e64fe37225a315c74c00d1f5e4d024168feea6.zip
Replace `interface{}` with `any` (#25686) (#25687)
Same perl replacement as https://github.com/go-gitea/gitea/pull/25686 but for 1.20 to ease future backporting.
Diffstat (limited to 'routers/web/repo/pull.go')
-rw-r--r--routers/web/repo/pull.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go
index 0127edb5a6..cd401b88f0 100644
--- a/routers/web/repo/pull.go
+++ b/routers/web/repo/pull.go
@@ -757,7 +757,7 @@ func ViewPullFiles(ctx *context.Context) {
return
}
- ctx.PageData["prReview"] = map[string]interface{}{
+ ctx.PageData["prReview"] = map[string]any{
"numberOfFiles": diff.NumFiles,
"numberOfViewedFiles": diff.NumViewedFiles,
}
@@ -892,7 +892,7 @@ func UpdatePullRequest(ctx *context.Context) {
if err = pull_service.Update(ctx, issue.PullRequest, ctx.Doer, message, rebase); err != nil {
if models.IsErrMergeConflicts(err) {
conflictError := err.(models.ErrMergeConflicts)
- flashError, err := ctx.RenderToString(tplAlertDetails, map[string]interface{}{
+ flashError, err := ctx.RenderToString(tplAlertDetails, map[string]any{
"Message": ctx.Tr("repo.pulls.merge_conflict"),
"Summary": ctx.Tr("repo.pulls.merge_conflict_summary"),
"Details": utils.SanitizeFlashErrorString(conflictError.StdErr) + "<br>" + utils.SanitizeFlashErrorString(conflictError.StdOut),
@@ -906,7 +906,7 @@ func UpdatePullRequest(ctx *context.Context) {
return
} else if models.IsErrRebaseConflicts(err) {
conflictError := err.(models.ErrRebaseConflicts)
- flashError, err := ctx.RenderToString(tplAlertDetails, map[string]interface{}{
+ flashError, err := ctx.RenderToString(tplAlertDetails, map[string]any{
"Message": ctx.Tr("repo.pulls.rebase_conflict", utils.SanitizeFlashErrorString(conflictError.CommitSHA)),
"Summary": ctx.Tr("repo.pulls.rebase_conflict_summary"),
"Details": utils.SanitizeFlashErrorString(conflictError.StdErr) + "<br>" + utils.SanitizeFlashErrorString(conflictError.StdOut),
@@ -1041,7 +1041,7 @@ func MergePullRequest(ctx *context.Context) {
ctx.Redirect(issue.Link())
} else if models.IsErrMergeConflicts(err) {
conflictError := err.(models.ErrMergeConflicts)
- flashError, err := ctx.RenderToString(tplAlertDetails, map[string]interface{}{
+ flashError, err := ctx.RenderToString(tplAlertDetails, map[string]any{
"Message": ctx.Tr("repo.editor.merge_conflict"),
"Summary": ctx.Tr("repo.editor.merge_conflict_summary"),
"Details": utils.SanitizeFlashErrorString(conflictError.StdErr) + "<br>" + utils.SanitizeFlashErrorString(conflictError.StdOut),
@@ -1054,7 +1054,7 @@ func MergePullRequest(ctx *context.Context) {
ctx.Redirect(issue.Link())
} else if models.IsErrRebaseConflicts(err) {
conflictError := err.(models.ErrRebaseConflicts)
- flashError, err := ctx.RenderToString(tplAlertDetails, map[string]interface{}{
+ flashError, err := ctx.RenderToString(tplAlertDetails, map[string]any{
"Message": ctx.Tr("repo.pulls.rebase_conflict", utils.SanitizeFlashErrorString(conflictError.CommitSHA)),
"Summary": ctx.Tr("repo.pulls.rebase_conflict_summary"),
"Details": utils.SanitizeFlashErrorString(conflictError.StdErr) + "<br>" + utils.SanitizeFlashErrorString(conflictError.StdOut),
@@ -1084,7 +1084,7 @@ func MergePullRequest(ctx *context.Context) {
if len(message) == 0 {
ctx.Flash.Error(ctx.Tr("repo.pulls.push_rejected_no_message"))
} else {
- flashError, err := ctx.RenderToString(tplAlertDetails, map[string]interface{}{
+ flashError, err := ctx.RenderToString(tplAlertDetails, map[string]any{
"Message": ctx.Tr("repo.pulls.push_rejected"),
"Summary": ctx.Tr("repo.pulls.push_rejected_summary"),
"Details": utils.SanitizeFlashErrorString(pushrejErr.Message),
@@ -1280,7 +1280,7 @@ func CompareAndPullRequestPost(ctx *context.Context) {
if len(message) == 0 {
ctx.Flash.Error(ctx.Tr("repo.pulls.push_rejected_no_message"))
} else {
- flashError, err := ctx.RenderToString(tplAlertDetails, map[string]interface{}{
+ flashError, err := ctx.RenderToString(tplAlertDetails, map[string]any{
"Message": ctx.Tr("repo.pulls.push_rejected"),
"Summary": ctx.Tr("repo.pulls.push_rejected_summary"),
"Details": utils.SanitizeFlashErrorString(pushrejErr.Message),
@@ -1386,7 +1386,7 @@ func CleanUpPullRequest(ctx *context.Context) {
}
defer func() {
- ctx.JSON(http.StatusOK, map[string]interface{}{
+ ctx.JSON(http.StatusOK, map[string]any{
"redirect": issue.Link(),
})
}()
@@ -1498,7 +1498,7 @@ func UpdatePullRequestTarget(ctx *context.Context) {
errorMessage := ctx.Tr("repo.pulls.has_pull_request", html.EscapeString(ctx.Repo.RepoLink+"/pulls/"+strconv.FormatInt(err.IssueID, 10)), html.EscapeString(RepoRelPath), err.IssueID) // FIXME: Creates url inside locale string
ctx.Flash.Error(errorMessage)
- ctx.JSON(http.StatusConflict, map[string]interface{}{
+ ctx.JSON(http.StatusConflict, map[string]any{
"error": err.Error(),
"user_error": errorMessage,
})
@@ -1506,7 +1506,7 @@ func UpdatePullRequestTarget(ctx *context.Context) {
errorMessage := ctx.Tr("repo.pulls.is_closed")
ctx.Flash.Error(errorMessage)
- ctx.JSON(http.StatusConflict, map[string]interface{}{
+ ctx.JSON(http.StatusConflict, map[string]any{
"error": err.Error(),
"user_error": errorMessage,
})
@@ -1514,7 +1514,7 @@ func UpdatePullRequestTarget(ctx *context.Context) {
errorMessage := ctx.Tr("repo.pulls.has_merged")
ctx.Flash.Error(errorMessage)
- ctx.JSON(http.StatusConflict, map[string]interface{}{
+ ctx.JSON(http.StatusConflict, map[string]any{
"error": err.Error(),
"user_error": errorMessage,
})
@@ -1522,7 +1522,7 @@ func UpdatePullRequestTarget(ctx *context.Context) {
errorMessage := ctx.Tr("repo.pulls.nothing_to_compare")
ctx.Flash.Error(errorMessage)
- ctx.JSON(http.StatusBadRequest, map[string]interface{}{
+ ctx.JSON(http.StatusBadRequest, map[string]any{
"error": err.Error(),
"user_error": errorMessage,
})
@@ -1533,7 +1533,7 @@ func UpdatePullRequestTarget(ctx *context.Context) {
}
notification.NotifyPullRequestChangeTargetBranch(ctx, ctx.Doer, pr, targetBranch)
- ctx.JSON(http.StatusOK, map[string]interface{}{
+ ctx.JSON(http.StatusOK, map[string]any{
"base_branch": pr.BaseBranch,
})
}
@@ -1561,7 +1561,7 @@ func SetAllowEdits(ctx *context.Context) {
return
}
- ctx.JSON(http.StatusOK, map[string]interface{}{
+ ctx.JSON(http.StatusOK, map[string]any{
"allow_maintainer_edit": pr.AllowMaintainerEdit,
})
}