From c53a1998c589a544b25d53f6e6fdf0f24a4df25b Mon Sep 17 00:00:00 2001 From: Joe Chen Date: Thu, 2 Feb 2023 21:25:25 +0800 Subject: all: replace `interface{}` with `any` (#7330) Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> --- internal/route/admin/auths.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/route/admin/auths.go') diff --git a/internal/route/admin/auths.go b/internal/route/admin/auths.go index 49839dae..a19888bb 100644 --- a/internal/route/admin/auths.go +++ b/internal/route/admin/auths.go @@ -47,7 +47,7 @@ func Authentications(c *context.Context) { type dropdownItem struct { Name string - Type interface{} + Type any } var ( @@ -130,7 +130,7 @@ func NewAuthSourcePost(c *context.Context, f form.Authentication) { c.Data["SMTPAuths"] = smtp.AuthTypes hasTLS := false - var config interface{} + var config any switch auth.Type(f.Type) { case auth.LDAP, auth.DLDAP: config = parseLDAPConfig(f) @@ -284,7 +284,7 @@ func DeleteAuthSource(c *context.Context) { } else { c.Flash.Error(fmt.Sprintf("DeleteSource: %v", err)) } - c.JSONSuccess(map[string]interface{}{ + c.JSONSuccess(map[string]any{ "redirect": conf.Server.Subpath + "/admin/auths/" + c.Params(":authid"), }) return @@ -292,7 +292,7 @@ func DeleteAuthSource(c *context.Context) { log.Trace("Authentication deleted by admin(%s): %d", c.User.Name, id) c.Flash.Success(c.Tr("admin.auths.deletion_success")) - c.JSONSuccess(map[string]interface{}{ + c.JSONSuccess(map[string]any{ "redirect": conf.Server.Subpath + "/admin/auths", }) } -- cgit v1.2.3