diff options
author | 6543 <6543@obermui.de> | 2022-01-20 18:46:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-20 18:46:10 +0100 |
commit | 54e9ee37a7a301dbe74d46fd3c87712e6120e9bf (patch) | |
tree | 1be12fb072625c1b896b9d72f7912b018aad502b /services/migrations/migrate.go | |
parent | 1d98d205f5825f40110e6628b61a97c91ac7f72d (diff) | |
download | gitea-54e9ee37a7a301dbe74d46fd3c87712e6120e9bf.tar.gz gitea-54e9ee37a7a301dbe74d46fd3c87712e6120e9bf.zip |
format with gofumpt (#18184)
* gofumpt -w -l .
* gofumpt -w -l -extra .
* Add linter
* manual fix
* change make fmt
Diffstat (limited to 'services/migrations/migrate.go')
-rw-r--r-- | services/migrations/migrate.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/services/migrations/migrate.go b/services/migrations/migrate.go index 65ecceddbe..7bca128ac5 100644 --- a/services/migrations/migrate.go +++ b/services/migrations/migrate.go @@ -123,7 +123,7 @@ func MigrateRepository(ctx context.Context, doer *user_model.User, ownerName str return nil, err } - var uploader = NewGiteaLocalUploader(ctx, doer, ownerName, opts.RepoName) + uploader := NewGiteaLocalUploader(ctx, doer, ownerName, opts.RepoName) uploader.gitServiceType = opts.GitServiceType if err := migrateRepository(downloader, uploader, opts, messenger); err != nil { @@ -305,7 +305,7 @@ func migrateRepository(downloader base.Downloader, uploader base.Uploader, opts if opts.Issues { log.Trace("migrating issues and comments") messenger("repo.migrate.migrating_issues") - var issueBatchSize = uploader.MaxBatchInsertSize("issue") + issueBatchSize := uploader.MaxBatchInsertSize("issue") for i := 1; ; i++ { issues, isEnd, err := downloader.GetIssues(i, issueBatchSize) @@ -322,7 +322,7 @@ func migrateRepository(downloader base.Downloader, uploader base.Uploader, opts } if opts.Comments && !supportAllComments { - var allComments = make([]*base.Comment, 0, commentBatchSize) + allComments := make([]*base.Comment, 0, commentBatchSize) for _, issue := range issues { log.Trace("migrating issue %d's comments", issue.Number) comments, _, err := downloader.GetComments(base.GetCommentOptions{ @@ -362,7 +362,7 @@ func migrateRepository(downloader base.Downloader, uploader base.Uploader, opts if opts.PullRequests { log.Trace("migrating pull requests and comments") messenger("repo.migrate.migrating_pulls") - var prBatchSize = uploader.MaxBatchInsertSize("pullrequest") + prBatchSize := uploader.MaxBatchInsertSize("pullrequest") for i := 1; ; i++ { prs, isEnd, err := downloader.GetPullRequests(i, prBatchSize) if err != nil { @@ -380,7 +380,7 @@ func migrateRepository(downloader base.Downloader, uploader base.Uploader, opts if opts.Comments { if !supportAllComments { // plain comments - var allComments = make([]*base.Comment, 0, commentBatchSize) + allComments := make([]*base.Comment, 0, commentBatchSize) for _, pr := range prs { log.Trace("migrating pull request %d's comments", pr.Number) comments, _, err := downloader.GetComments(base.GetCommentOptions{ @@ -410,7 +410,7 @@ func migrateRepository(downloader base.Downloader, uploader base.Uploader, opts } // migrate reviews - var allReviews = make([]*base.Review, 0, reviewBatchSize) + allReviews := make([]*base.Review, 0, reviewBatchSize) for _, pr := range prs { reviews, err := downloader.GetReviews(pr.Context) if err != nil { |