diff options
author | Wim <wim@42.be> | 2017-09-19 00:04:27 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2017-09-19 00:04:27 +0200 |
commit | d59c51a94b624ac6933cdbf1468211eac8546632 (patch) | |
tree | 78e6345bac93cabbaabaef073253cea7c5542630 /bridge | |
parent | 47b7fae61be81ddd6089a1cff9763522b3e45bd9 (diff) | |
download | matterbridge-msglm-d59c51a94b624ac6933cdbf1468211eac8546632.tar.gz matterbridge-msglm-d59c51a94b624ac6933cdbf1468211eac8546632.tar.bz2 matterbridge-msglm-d59c51a94b624ac6933cdbf1468211eac8546632.zip |
Remove unnecessary check, make megacheck happy
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/slack/slack.go | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index 21163116..c72d223b 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -394,25 +394,23 @@ func (b *Bslack) replaceURL(text string) string { func (b *Bslack) createAttach(extra []interface{}) []slack.Attachment { var attachs []slack.Attachment - if extra != nil { - for _, v := range extra { - entry := v.(map[string]interface{}) - s := slack.Attachment{} - s.Fallback = entry["fallback"].(string) - s.Color = entry["color"].(string) - s.Pretext = entry["pretext"].(string) - s.AuthorName = entry["author_name"].(string) - s.AuthorLink = entry["author_link"].(string) - s.AuthorIcon = entry["author_icon"].(string) - s.Title = entry["title"].(string) - s.TitleLink = entry["title_link"].(string) - s.Text = entry["text"].(string) - s.ImageURL = entry["image_url"].(string) - s.ThumbURL = entry["thumb_url"].(string) - s.Footer = entry["footer"].(string) - s.FooterIcon = entry["footer_icon"].(string) - attachs = append(attachs, s) - } + for _, v := range extra { + entry := v.(map[string]interface{}) + s := slack.Attachment{} + s.Fallback = entry["fallback"].(string) + s.Color = entry["color"].(string) + s.Pretext = entry["pretext"].(string) + s.AuthorName = entry["author_name"].(string) + s.AuthorLink = entry["author_link"].(string) + s.AuthorIcon = entry["author_icon"].(string) + s.Title = entry["title"].(string) + s.TitleLink = entry["title_link"].(string) + s.Text = entry["text"].(string) + s.ImageURL = entry["image_url"].(string) + s.ThumbURL = entry["thumb_url"].(string) + s.Footer = entry["footer"].(string) + s.FooterIcon = entry["footer_icon"].(string) + attachs = append(attachs, s) } return attachs } |