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:
@@ -79,7 +79,7 @@ func TeamsAction(ctx *context.Context) {
|
||||
ctx.Flash.Error(ctx.Tr("form.last_org_owner"))
|
||||
} else {
|
||||
log.Error("Action(%s): %v", ctx.Params(":action"), err)
|
||||
ctx.JSON(http.StatusOK, map[string]interface{}{
|
||||
ctx.JSON(http.StatusOK, map[string]any{
|
||||
"ok": false,
|
||||
"err": err.Error(),
|
||||
})
|
||||
@@ -95,7 +95,7 @@ func TeamsAction(ctx *context.Context) {
|
||||
redirect = setting.AppSubURL + "/"
|
||||
}
|
||||
ctx.JSON(http.StatusOK,
|
||||
map[string]interface{}{
|
||||
map[string]any{
|
||||
"redirect": redirect,
|
||||
})
|
||||
return
|
||||
@@ -117,7 +117,7 @@ func TeamsAction(ctx *context.Context) {
|
||||
ctx.Flash.Error(ctx.Tr("form.last_org_owner"))
|
||||
} else {
|
||||
log.Error("Action(%s): %v", ctx.Params(":action"), err)
|
||||
ctx.JSON(http.StatusOK, map[string]interface{}{
|
||||
ctx.JSON(http.StatusOK, map[string]any{
|
||||
"ok": false,
|
||||
"err": err.Error(),
|
||||
})
|
||||
@@ -125,7 +125,7 @@ func TeamsAction(ctx *context.Context) {
|
||||
}
|
||||
}
|
||||
ctx.JSON(http.StatusOK,
|
||||
map[string]interface{}{
|
||||
map[string]any{
|
||||
"redirect": ctx.Org.OrgLink + "/teams/" + url.PathEscape(ctx.Org.Team.LowerName),
|
||||
})
|
||||
return
|
||||
@@ -199,7 +199,7 @@ func TeamsAction(ctx *context.Context) {
|
||||
ctx.Flash.Error(ctx.Tr("form.last_org_owner"))
|
||||
} else {
|
||||
log.Error("Action(%s): %v", ctx.Params(":action"), err)
|
||||
ctx.JSON(http.StatusOK, map[string]interface{}{
|
||||
ctx.JSON(http.StatusOK, map[string]any{
|
||||
"ok": false,
|
||||
"err": err.Error(),
|
||||
})
|
||||
@@ -256,7 +256,7 @@ func TeamsRepoAction(ctx *context.Context) {
|
||||
}
|
||||
|
||||
if action == "addall" || action == "removeall" {
|
||||
ctx.JSON(http.StatusOK, map[string]interface{}{
|
||||
ctx.JSON(http.StatusOK, map[string]any{
|
||||
"redirect": ctx.Org.OrgLink + "/teams/" + url.PathEscape(ctx.Org.Team.LowerName) + "/repositories",
|
||||
})
|
||||
return
|
||||
@@ -414,7 +414,7 @@ func SearchTeam(ctx *context.Context) {
|
||||
teams, maxResults, err := org_model.SearchTeam(opts)
|
||||
if err != nil {
|
||||
log.Error("SearchTeam failed: %v", err)
|
||||
ctx.JSON(http.StatusInternalServerError, map[string]interface{}{
|
||||
ctx.JSON(http.StatusInternalServerError, map[string]any{
|
||||
"ok": false,
|
||||
"error": "SearchTeam internal failure",
|
||||
})
|
||||
@@ -424,7 +424,7 @@ func SearchTeam(ctx *context.Context) {
|
||||
apiTeams, err := convert.ToTeams(ctx, teams, false)
|
||||
if err != nil {
|
||||
log.Error("convert ToTeams failed: %v", err)
|
||||
ctx.JSON(http.StatusInternalServerError, map[string]interface{}{
|
||||
ctx.JSON(http.StatusInternalServerError, map[string]any{
|
||||
"ok": false,
|
||||
"error": "SearchTeam failed to get units",
|
||||
})
|
||||
@@ -432,7 +432,7 @@ func SearchTeam(ctx *context.Context) {
|
||||
}
|
||||
|
||||
ctx.SetTotalCountHeader(maxResults)
|
||||
ctx.JSON(http.StatusOK, map[string]interface{}{
|
||||
ctx.JSON(http.StatusOK, map[string]any{
|
||||
"ok": true,
|
||||
"data": apiTeams,
|
||||
})
|
||||
@@ -530,7 +530,7 @@ func DeleteTeam(ctx *context.Context) {
|
||||
ctx.Flash.Success(ctx.Tr("org.teams.delete_team_success"))
|
||||
}
|
||||
|
||||
ctx.JSON(http.StatusOK, map[string]interface{}{
|
||||
ctx.JSON(http.StatusOK, map[string]any{
|
||||
"redirect": ctx.Org.OrgLink + "/teams",
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user