summaryrefslogtreecommitdiffstats
path: root/app/notification.go
diff options
context:
space:
mode:
authorJesús Espino <jespinog@gmail.com>2018-10-01 10:22:31 +0200
committerGitHub <noreply@github.com>2018-10-01 10:22:31 +0200
commita6fa2b72d1375e554cc6f2e5ca2fd4884a8509f4 (patch)
tree86fad78092116e88230b71bc56b47e9e8f125a07 /app/notification.go
parenta8c01377bce777bf1940850e390e587c290e98e0 (diff)
downloadchat-a6fa2b72d1375e554cc6f2e5ca2fd4884a8509f4.tar.gz
chat-a6fa2b72d1375e554cc6f2e5ca2fd4884a8509f4.tar.bz2
chat-a6fa2b72d1375e554cc6f2e5ca2fd4884a8509f4.zip
Migrate to idiomatic error handling app/notification*.go (#9487)
Diffstat (limited to 'app/notification.go')
-rw-r--r--app/notification.go14
1 files changed, 6 insertions, 8 deletions
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)