diff options
author | Chongyi Zheng <git@zcy.dev> | 2024-04-29 10:47:56 +0200 |
---|---|---|
committer | Earl Warren <contact@earl-warren.org> | 2024-05-05 09:38:16 +0200 |
commit | c504461b66fb36aa6ed758d6c967c3296560644d (patch) | |
tree | 788eb90908b2d9405c4c07118f731f4f5f73f918 /services/migrations | |
parent | Add support for npm bundleDependencies (#30751) (diff) | |
download | forgejo-c504461b66fb36aa6ed758d6c967c3296560644d.tar.xz forgejo-c504461b66fb36aa6ed758d6c967c3296560644d.zip |
Resolve lint for unused parameter and unnecessary type arguments (#30750)
Resolve all cases for `unused parameter` and `unnecessary type
arguments`
Related: #30729
---------
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit e80466f7349164ce4cf3c07bdac30d736d20f035)
Conflicts:
modules/markup/markdown/transform_codespan.go
modules/setting/incoming_email.go
routers/api/v1/admin/user_badge.go
routers/private/hook_pre_receive.go
tests/integration/repo_search_test.go
resolved by discarding the change, this is linting only and
for the sake of avoiding future conflicts
Diffstat (limited to 'services/migrations')
-rw-r--r-- | services/migrations/gitea_uploader.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/services/migrations/gitea_uploader.go b/services/migrations/gitea_uploader.go index 9baae6d31d..21a9c53a5c 100644 --- a/services/migrations/gitea_uploader.go +++ b/services/migrations/gitea_uploader.go @@ -982,25 +982,24 @@ func (g *GiteaLocalUploader) Finish() error { } func (g *GiteaLocalUploader) remapUser(source user_model.ExternalUserMigrated, target user_model.ExternalUserRemappable) error { - var userid int64 + var userID int64 var err error if g.sameApp { - userid, err = g.remapLocalUser(source, target) + userID, err = g.remapLocalUser(source) } else { - userid, err = g.remapExternalUser(source, target) + userID, err = g.remapExternalUser(source) } - if err != nil { return err } - if userid > 0 { - return target.RemapExternalUser("", 0, userid) + if userID > 0 { + return target.RemapExternalUser("", 0, userID) } return target.RemapExternalUser(source.GetExternalName(), source.GetExternalID(), g.doer.ID) } -func (g *GiteaLocalUploader) remapLocalUser(source user_model.ExternalUserMigrated, target user_model.ExternalUserRemappable) (int64, error) { +func (g *GiteaLocalUploader) remapLocalUser(source user_model.ExternalUserMigrated) (int64, error) { userid, ok := g.userMap[source.GetExternalID()] if !ok { name, err := user_model.GetUserNameByID(g.ctx, source.GetExternalID()) @@ -1018,7 +1017,7 @@ func (g *GiteaLocalUploader) remapLocalUser(source user_model.ExternalUserMigrat return userid, nil } -func (g *GiteaLocalUploader) remapExternalUser(source user_model.ExternalUserMigrated, target user_model.ExternalUserRemappable) (userid int64, err error) { +func (g *GiteaLocalUploader) remapExternalUser(source user_model.ExternalUserMigrated) (userid int64, err error) { userid, ok := g.userMap[source.GetExternalID()] if !ok { userid, err = user_model.GetUserIDByExternalUserID(g.ctx, g.gitServiceType.Name(), fmt.Sprintf("%d", source.GetExternalID())) |