diff options
author | silverwind <me@silverwind.io> | 2023-07-05 05:41:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-04 23:41:32 -0400 |
commit | 24e64fe37225a315c74c00d1f5e4d024168feea6 (patch) | |
tree | c89664dca5a884d5fc0a322815ce3bc20247cf84 /models/asymkey | |
parent | 4e310133f95ba8581c121a32596807721bdd6af9 (diff) | |
download | gitea-24e64fe37225a315c74c00d1f5e4d024168feea6.tar.gz gitea-24e64fe37225a315c74c00d1f5e4d024168feea6.zip |
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.
Diffstat (limited to 'models/asymkey')
-rw-r--r-- | models/asymkey/ssh_key_authorized_keys.go | 4 | ||||
-rw-r--r-- | models/asymkey/ssh_key_authorized_principals.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/models/asymkey/ssh_key_authorized_keys.go b/models/asymkey/ssh_key_authorized_keys.go index e138182d68..77803d6709 100644 --- a/models/asymkey/ssh_key_authorized_keys.go +++ b/models/asymkey/ssh_key_authorized_keys.go @@ -47,7 +47,7 @@ var sshOpLocker sync.Mutex // AuthorizedStringForKey creates the authorized keys string appropriate for the provided key func AuthorizedStringForKey(key *PublicKey) string { sb := &strings.Builder{} - _ = setting.SSH.AuthorizedKeysCommandTemplateTemplate.Execute(sb, map[string]interface{}{ + _ = setting.SSH.AuthorizedKeysCommandTemplateTemplate.Execute(sb, map[string]any{ "AppPath": util.ShellEscape(setting.AppPath), "AppWorkPath": util.ShellEscape(setting.AppWorkPath), "CustomConf": util.ShellEscape(setting.CustomConf), @@ -175,7 +175,7 @@ func RewriteAllPublicKeys() error { // RegeneratePublicKeys regenerates the authorized_keys file func RegeneratePublicKeys(ctx context.Context, t io.StringWriter) error { - if err := db.GetEngine(ctx).Where("type != ?", KeyTypePrincipal).Iterate(new(PublicKey), func(idx int, bean interface{}) (err error) { + if err := db.GetEngine(ctx).Where("type != ?", KeyTypePrincipal).Iterate(new(PublicKey), func(idx int, bean any) (err error) { _, err = t.WriteString((bean.(*PublicKey)).AuthorizedString()) return err }); err != nil { diff --git a/models/asymkey/ssh_key_authorized_principals.go b/models/asymkey/ssh_key_authorized_principals.go index 092839611f..592196c255 100644 --- a/models/asymkey/ssh_key_authorized_principals.go +++ b/models/asymkey/ssh_key_authorized_principals.go @@ -97,7 +97,7 @@ func RewriteAllPrincipalKeys(ctx context.Context) error { } func regeneratePrincipalKeys(ctx context.Context, t io.StringWriter) error { - if err := db.GetEngine(ctx).Where("type = ?", KeyTypePrincipal).Iterate(new(PublicKey), func(idx int, bean interface{}) (err error) { + if err := db.GetEngine(ctx).Where("type = ?", KeyTypePrincipal).Iterate(new(PublicKey), func(idx int, bean any) (err error) { _, err = t.WriteString((bean.(*PublicKey)).AuthorizedString()) return err }); err != nil { |