mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +00:00
Replace interface{}
with any
(#25686)
Result of running `perl -p -i -e 's#interface\{\}#any#g' **/*` and `make fmt`.
Basically the same [as golang did](2580d0e08d
).
This commit is contained in:
@@ -802,7 +802,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,
|
||||
}
|
||||
@@ -937,7 +937,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),
|
||||
@@ -951,7 +951,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),
|
||||
@@ -1086,7 +1086,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),
|
||||
@@ -1099,7 +1099,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),
|
||||
@@ -1129,7 +1129,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),
|
||||
@@ -1302,7 +1302,7 @@ func CompareAndPullRequestPost(ctx *context.Context) {
|
||||
ctx.JSONError(ctx.Tr("repo.pulls.push_rejected_no_message"))
|
||||
return
|
||||
}
|
||||
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),
|
||||
@@ -1407,7 +1407,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(),
|
||||
})
|
||||
}()
|
||||
@@ -1519,7 +1519,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,
|
||||
})
|
||||
@@ -1527,7 +1527,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,
|
||||
})
|
||||
@@ -1535,7 +1535,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,
|
||||
})
|
||||
@@ -1543,7 +1543,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,
|
||||
})
|
||||
@@ -1554,7 +1554,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,
|
||||
})
|
||||
}
|
||||
@@ -1582,7 +1582,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,
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user