From f7a5077d5d8dee61e86f5ec8b17b66bf257dd68c Mon Sep 17 00:00:00 2001 From: Wim Date: Tue, 13 Nov 2018 20:40:15 +0100 Subject: [PATCH] Fix goconst linter failure --- bridge/mattermost/mattermost.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go index 46eac03f..26a6cb4b 100644 --- a/bridge/mattermost/mattermost.go +++ b/bridge/mattermost/mattermost.go @@ -23,6 +23,8 @@ type Bmattermost struct { avatarMap map[string]string } +const mattermostPlugin = "mattermost.plugin" + func New(cfg *bridge.Config) bridge.Bridger { b := &Bmattermost{Config: cfg, avatarMap: make(map[string]string)} b.uuid = xid.New().String() @@ -34,7 +36,7 @@ func (b *Bmattermost) Command(cmd string) string { } func (b *Bmattermost) Connect() error { - if b.Account == "mattermost.plugin" { + if b.Account == mattermostPlugin { return nil } if b.GetString("WebhookBindAddress") != "" { @@ -113,7 +115,7 @@ func (b *Bmattermost) Disconnect() error { } func (b *Bmattermost) JoinChannel(channel config.ChannelInfo) error { - if b.Account == "mattermost.plugin" { + if b.Account == mattermostPlugin { return nil } // we can only join channels using the API @@ -128,7 +130,7 @@ func (b *Bmattermost) JoinChannel(channel config.ChannelInfo) error { } func (b *Bmattermost) Send(msg config.Message) (string, error) { - if b.Account == "mattermost.plugin" { + if b.Account == mattermostPlugin { return "", nil } b.Log.Debugf("=> Receiving %#v", msg)