mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +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:
@@ -29,8 +29,8 @@ func GetContentHistoryOverview(ctx *context.Context) {
|
||||
}
|
||||
|
||||
editedHistoryCountMap, _ := issues_model.QueryIssueContentHistoryEditedCountMap(ctx, issue.ID)
|
||||
ctx.JSON(http.StatusOK, map[string]interface{}{
|
||||
"i18n": map[string]interface{}{
|
||||
ctx.JSON(http.StatusOK, map[string]any{
|
||||
"i18n": map[string]any{
|
||||
"textEdited": ctx.Tr("repo.issues.content_history.edited"),
|
||||
"textDeleteFromHistory": ctx.Tr("repo.issues.content_history.delete_from_history"),
|
||||
"textDeleteFromHistoryConfirm": ctx.Tr("repo.issues.content_history.delete_from_history_confirm"),
|
||||
@@ -53,7 +53,7 @@ func GetContentHistoryList(ctx *context.Context) {
|
||||
// render history list to HTML for frontend dropdown items: (name, value)
|
||||
// name is HTML of "avatar + userName + userAction + timeSince"
|
||||
// value is historyId
|
||||
var results []map[string]interface{}
|
||||
var results []map[string]any
|
||||
for _, item := range items {
|
||||
var actionText string
|
||||
if item.IsDeleted {
|
||||
@@ -76,13 +76,13 @@ func GetContentHistoryList(ctx *context.Context) {
|
||||
avatarHTML := string(templates.AvatarHTML(src, 28, class, username))
|
||||
timeSinceText := string(timeutil.TimeSinceUnix(item.EditedUnix, ctx.Locale))
|
||||
|
||||
results = append(results, map[string]interface{}{
|
||||
results = append(results, map[string]any{
|
||||
"name": avatarHTML + "<strong>" + name + "</strong> " + actionText + " " + timeSinceText,
|
||||
"value": item.HistoryID,
|
||||
})
|
||||
}
|
||||
|
||||
ctx.JSON(http.StatusOK, map[string]interface{}{
|
||||
ctx.JSON(http.StatusOK, map[string]any{
|
||||
"results": results,
|
||||
})
|
||||
}
|
||||
@@ -120,7 +120,7 @@ func GetContentHistoryDetail(ctx *context.Context) {
|
||||
historyID := ctx.FormInt64("history_id")
|
||||
history, prevHistory, err := issues_model.GetIssueContentHistoryAndPrev(ctx, historyID)
|
||||
if err != nil {
|
||||
ctx.JSON(http.StatusNotFound, map[string]interface{}{
|
||||
ctx.JSON(http.StatusNotFound, map[string]any{
|
||||
"message": "Can not find the content history",
|
||||
})
|
||||
return
|
||||
@@ -168,7 +168,7 @@ func GetContentHistoryDetail(ctx *context.Context) {
|
||||
}
|
||||
diffHTMLBuf.WriteString("</pre>")
|
||||
|
||||
ctx.JSON(http.StatusOK, map[string]interface{}{
|
||||
ctx.JSON(http.StatusOK, map[string]any{
|
||||
"canSoftDelete": canSoftDeleteContentHistory(ctx, issue, comment, history),
|
||||
"historyId": historyID,
|
||||
"prevHistoryId": prevHistoryID,
|
||||
@@ -202,7 +202,7 @@ func SoftDeleteContentHistory(ctx *context.Context) {
|
||||
|
||||
canSoftDelete := canSoftDeleteContentHistory(ctx, issue, comment, history)
|
||||
if !canSoftDelete {
|
||||
ctx.JSON(http.StatusForbidden, map[string]interface{}{
|
||||
ctx.JSON(http.StatusForbidden, map[string]any{
|
||||
"message": "Can not delete the content history",
|
||||
})
|
||||
return
|
||||
@@ -210,7 +210,7 @@ func SoftDeleteContentHistory(ctx *context.Context) {
|
||||
|
||||
err = issues_model.SoftDeleteIssueContentHistory(ctx, historyID)
|
||||
log.Debug("soft delete issue content history. issue=%d, comment=%d, history=%d", issue.ID, commentID, historyID)
|
||||
ctx.JSON(http.StatusOK, map[string]interface{}{
|
||||
ctx.JSON(http.StatusOK, map[string]any{
|
||||
"ok": err == nil,
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user