1
1
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:
silverwind
2023-07-04 20:36:08 +02:00
committed by GitHub
parent 00dbba7f42
commit 88f835192d
233 changed files with 727 additions and 727 deletions

View File

@@ -205,7 +205,7 @@ loop:
if err := c.Store(
handledSet,
imap.FormatFlagsOp(imap.AddFlags, true),
[]interface{}{imap.DeletedFlag},
[]any{imap.DeletedFlag},
nil,
); err != nil {
return fmt.Errorf("imap store failed: %w", err)

View File

@@ -20,7 +20,7 @@ const (
)
// CreateReferencePayload creates data which GetReferenceFromPayload resolves to the reference again.
func CreateReferencePayload(reference interface{}) ([]byte, error) {
func CreateReferencePayload(reference any) ([]byte, error) {
var refType payloadReferenceType
var refID int64
@@ -44,7 +44,7 @@ func CreateReferencePayload(reference interface{}) ([]byte, error) {
}
// GetReferenceFromPayload resolves the reference from the payload
func GetReferenceFromPayload(ctx context.Context, payload []byte) (interface{}, error) {
func GetReferenceFromPayload(ctx context.Context, payload []byte) (any, error) {
if len(payload) < 1 {
return nil, util.NewInvalidArgumentErrorf("payload to small")
}

View File

@@ -67,7 +67,7 @@ func SendTestMail(email string) error {
// sendUserMail sends a mail to the user
func sendUserMail(language string, u *user_model.User, tpl base.TplName, code, subject, info string) {
locale := translation.NewLocale(language)
data := map[string]interface{}{
data := map[string]any{
"DisplayName": u.DisplayName(),
"ActiveCodeLives": timeutil.MinutesToFriendly(setting.Service.ActiveCodeLives, locale),
"ResetPwdCodeLives": timeutil.MinutesToFriendly(setting.Service.ResetPwdCodeLives, locale),
@@ -118,7 +118,7 @@ func SendActivateEmailMail(u *user_model.User, email *user_model.EmailAddress) {
return
}
locale := translation.NewLocale(u.Language)
data := map[string]interface{}{
data := map[string]any{
"DisplayName": u.DisplayName(),
"ActiveCodeLives": timeutil.MinutesToFriendly(setting.Service.ActiveCodeLives, locale),
"Code": u.GenerateEmailActivateCode(email.Email),
@@ -151,7 +151,7 @@ func SendRegisterNotifyMail(u *user_model.User) {
}
locale := translation.NewLocale(u.Language)
data := map[string]interface{}{
data := map[string]any{
"DisplayName": u.DisplayName(),
"Username": u.Name,
"Language": locale.Language(),
@@ -184,7 +184,7 @@ func SendCollaboratorMail(u, doer *user_model.User, repo *repo_model.Repository)
repoName := repo.FullName()
subject := locale.Tr("mail.repo.collaborator.added.subject", doer.DisplayName(), repoName)
data := map[string]interface{}{
data := map[string]any{
"Subject": subject,
"RepoName": repoName,
"Link": repo.HTMLURL(),
@@ -258,7 +258,7 @@ func composeIssueCommentMessages(ctx *mailCommentContext, lang string, recipient
}
locale := translation.NewLocale(lang)
mailMeta := map[string]interface{}{
mailMeta := map[string]any{
"FallbackSubject": fallback,
"Body": body,
"Link": link,

View File

@@ -68,7 +68,7 @@ func mailNewRelease(ctx context.Context, lang string, tos []string, rel *repo_mo
}
subject := locale.Tr("mail.release.new.subject", rel.TagName, rel.Repo.FullName())
mailMeta := map[string]interface{}{
mailMeta := map[string]any{
"Release": rel,
"Subject": subject,
"Language": locale.Language(),

View File

@@ -64,7 +64,7 @@ func sendRepoTransferNotifyMailPerLang(lang string, newOwner, doer *user_model.U
subject = locale.Tr("mail.repo.transfer.subject_to", doer.DisplayName(), repo.FullName(), destination)
}
data := map[string]interface{}{
data := map[string]any{
"Doer": doer,
"User": repo.Owner,
"Repo": repo.FullName(),

View File

@@ -34,7 +34,7 @@ func MailTeamInvite(ctx context.Context, inviter *user_model.User, team *org_mod
locale := translation.NewLocale(inviter.Language)
subject := locale.Tr("mail.team_invite.subject", inviter.DisplayName(), org.DisplayName())
mailMeta := map[string]interface{}{
mailMeta := map[string]any{
"Inviter": inviter,
"Organization": org,
"Team": team,