MM-22783: Fix scopelint issues (#13969)
* Fix scopelint issues * Incorporating review comments * Keeping the order of linters alphabetical * Fix issues after merge Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
4ac0619c90
Коммит
c8b60c2d75
@@ -855,6 +855,7 @@ func (a *App) importReplies(data []ReplyImportData, post *model.Post, teamId str
|
||||
var err *model.AppError
|
||||
usernames := []string{}
|
||||
for _, replyData := range data {
|
||||
replyData := replyData
|
||||
if err = validateReplyImportData(&replyData, post.CreateAt, a.MaxPostSize()); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -871,6 +872,7 @@ func (a *App) importReplies(data []ReplyImportData, post *model.Post, teamId str
|
||||
postsForOverwriteList := []*model.Post{}
|
||||
|
||||
for _, replyData := range data {
|
||||
replyData := replyData
|
||||
user := users[*replyData.User]
|
||||
|
||||
// Check if this post already exists.
|
||||
@@ -1144,6 +1146,7 @@ func (a *App) importMultiplePosts(data []*PostImportData, dryRun bool) *model.Ap
|
||||
var lastPostWithData *postAndData
|
||||
repliesBulk := []ReplyImportData{}
|
||||
for _, postWithData := range postsWithData {
|
||||
postWithData := postWithData
|
||||
if postWithData.postData.FlaggedBy != nil {
|
||||
var preferences model.Preferences
|
||||
|
||||
@@ -1167,6 +1170,7 @@ func (a *App) importMultiplePosts(data []*PostImportData, dryRun bool) *model.Ap
|
||||
|
||||
if postWithData.postData.Reactions != nil {
|
||||
for _, reaction := range *postWithData.postData.Reactions {
|
||||
reaction := reaction
|
||||
if err := a.importReaction(&reaction, postWithData.post, dryRun); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -1204,6 +1208,7 @@ func (a *App) uploadAttachments(attachments *[]AttachmentImportData, post *model
|
||||
}
|
||||
fileIds := make(map[string]bool)
|
||||
for _, attachment := range *attachments {
|
||||
attachment := attachment
|
||||
fileInfo, err := a.importAttachment(&attachment, post, teamId, dryRun)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1432,6 +1437,7 @@ func (a *App) importMultipleDirectPosts(data []*DirectPostImportData, dryRun boo
|
||||
|
||||
if postWithData.directPostData.Reactions != nil {
|
||||
for _, reaction := range *postWithData.directPostData.Reactions {
|
||||
reaction := reaction
|
||||
if err := a.importReaction(&reaction, postWithData.post, dryRun); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user