diff options
author | Wim <wim@42.be> | 2017-07-14 00:35:01 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2017-07-14 00:35:01 +0200 |
commit | 6dee988b76852c6b15ef59061896ce48ce6ba978 (patch) | |
tree | b2a187be4850e212400bb9627e60327c63370b30 /matterclient | |
parent | 5af40db3965649348143a530bea671574fb1ef54 (diff) | |
download | matterbridge-msglm-6dee988b76852c6b15ef59061896ce48ce6ba978.tar.gz matterbridge-msglm-6dee988b76852c6b15ef59061896ce48ce6ba978.tar.bz2 matterbridge-msglm-6dee988b76852c6b15ef59061896ce48ce6ba978.zip |
Fix megacheck / go vet issues
Diffstat (limited to 'matterclient')
-rw-r--r-- | matterclient/matterclient.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go index 47fb2113..75d883f3 100644 --- a/matterclient/matterclient.go +++ b/matterclient/matterclient.go @@ -88,7 +88,7 @@ func (m *MMClient) SetLogLevel(level string) { func (m *MMClient) Login() error { // check if this is a first connect or a reconnection firstConnection := true - if m.WsConnected == true { + if m.WsConnected { firstConnection = false } m.WsConnected = false @@ -149,7 +149,7 @@ func (m *MMClient) Login() error { return errors.New("invalid " + model.SESSION_COOKIE_TOKEN) } } else { - myinfo, appErr = m.Client.Login(m.Credentials.Login, m.Credentials.Pass) + _, appErr = m.Client.Login(m.Credentials.Login, m.Credentials.Pass) } if appErr != nil { d := b.Duration() @@ -329,7 +329,6 @@ func (m *MMClient) parseActionPost(rmsg *Message) { } rmsg.Text = data.Message rmsg.Post = data - return } func (m *MMClient) UpdateUsers() error { @@ -535,7 +534,7 @@ func (m *MMClient) UpdateLastViewed(channelId string) { if m.mmVersion() >= 3.08 { view := model.ChannelView{ChannelId: channelId} res, _ := m.Client.ViewChannel(view) - if res == false { + if !res { m.log.Errorf("ChannelView update for %s failed", channelId) } return @@ -683,13 +682,13 @@ func (m *MMClient) GetUsers() map[string]*model.User { func (m *MMClient) GetUser(userId string) *model.User { m.Lock() defer m.Unlock() - u, ok := m.Users[userId] + _, ok := m.Users[userId] if !ok { res, err := m.Client.GetProfilesByIds([]string{userId}) if err != nil { return nil } - u = res.Data.(map[string]*model.User)[userId] + u := res.Data.(map[string]*model.User)[userId] m.Users[userId] = u } return m.Users[userId] |