From a6fa2b72d1375e554cc6f2e5ca2fd4884a8509f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Mon, 1 Oct 2018 10:22:31 +0200 Subject: Migrate to idiomatic error handling app/notification*.go (#9487) --- app/notification.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'app/notification.go') diff --git a/app/notification.go b/app/notification.go index 8092ba436..02f766d4d 100644 --- a/app/notification.go +++ b/app/notification.go @@ -35,19 +35,17 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod fchan = a.Srv.Store.FileInfo().GetForPost(post.Id, true, true) } - var profileMap map[string]*model.User - if result := <-pchan; result.Err != nil { + result := <-pchan + if result.Err != nil { return nil, result.Err - } else { - profileMap = result.Data.(map[string]*model.User) } + profileMap := result.Data.(map[string]*model.User) - var channelMemberNotifyPropsMap map[string]model.StringMap - if result := <-cmnchan; result.Err != nil { + result = <-cmnchan + if result.Err != nil { return nil, result.Err - } else { - channelMemberNotifyPropsMap = result.Data.(map[string]model.StringMap) } + channelMemberNotifyPropsMap := result.Data.(map[string]model.StringMap) mentionedUserIds := make(map[string]bool) threadMentionedUserIds := make(map[string]string) -- cgit v1.2.3-1-g7c22