1
0
Fork 0
forked from forgejo/forgejo

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.
This commit is contained in:
silverwind 2023-07-05 05:41:32 +02:00 committed by GitHub
parent 4e310133f9
commit 24e64fe372
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
233 changed files with 729 additions and 729 deletions

View file

@ -47,7 +47,7 @@ var (
)
)
func jsonResponse(ctx *context.Context, status int, obj interface{}) {
func jsonResponse(ctx *context.Context, status int, obj any) {
// https://github.com/conan-io/conan/issues/6613
ctx.Resp.Header().Set("Content-Type", "application/json")
ctx.Status(status)
@ -56,7 +56,7 @@ func jsonResponse(ctx *context.Context, status int, obj interface{}) {
}
}
func apiError(ctx *context.Context, status int, obj interface{}) {
func apiError(ctx *context.Context, status int, obj any) {
helper.LogAndProcessError(ctx, status, obj, func(message string) {
jsonResponse(ctx, status, map[string]string{
"message": message,
@ -800,13 +800,13 @@ func listRevisionFiles(ctx *context.Context, fileKey string) {
return
}
files := make(map[string]interface{})
files := make(map[string]any)
for _, pf := range pfs {
files[pf.Name] = nil
}
type FileList struct {
Files map[string]interface{} `json:"files"`
Files map[string]any `json:"files"`
}
jsonResponse(ctx, http.StatusOK, &FileList{