5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-29 14:01:35 +00:00

Remove unnecessary check, make megacheck happy

This commit is contained in:
Wim 2017-09-19 00:04:27 +02:00
parent 47b7fae61b
commit d59c51a94b

View File

@ -394,25 +394,23 @@ func (b *Bslack) replaceURL(text string) string {
func (b *Bslack) createAttach(extra []interface{}) []slack.Attachment { func (b *Bslack) createAttach(extra []interface{}) []slack.Attachment {
var attachs []slack.Attachment var attachs []slack.Attachment
if extra != nil { for _, v := range extra {
for _, v := range extra { entry := v.(map[string]interface{})
entry := v.(map[string]interface{}) s := slack.Attachment{}
s := slack.Attachment{} s.Fallback = entry["fallback"].(string)
s.Fallback = entry["fallback"].(string) s.Color = entry["color"].(string)
s.Color = entry["color"].(string) s.Pretext = entry["pretext"].(string)
s.Pretext = entry["pretext"].(string) s.AuthorName = entry["author_name"].(string)
s.AuthorName = entry["author_name"].(string) s.AuthorLink = entry["author_link"].(string)
s.AuthorLink = entry["author_link"].(string) s.AuthorIcon = entry["author_icon"].(string)
s.AuthorIcon = entry["author_icon"].(string) s.Title = entry["title"].(string)
s.Title = entry["title"].(string) s.TitleLink = entry["title_link"].(string)
s.TitleLink = entry["title_link"].(string) s.Text = entry["text"].(string)
s.Text = entry["text"].(string) s.ImageURL = entry["image_url"].(string)
s.ImageURL = entry["image_url"].(string) s.ThumbURL = entry["thumb_url"].(string)
s.ThumbURL = entry["thumb_url"].(string) s.Footer = entry["footer"].(string)
s.Footer = entry["footer"].(string) s.FooterIcon = entry["footer_icon"].(string)
s.FooterIcon = entry["footer_icon"].(string) attachs = append(attachs, s)
attachs = append(attachs, s)
}
} }
return attachs return attachs
} }