From 9619dff33417548a50e51a4f75f41b9de4a73327 Mon Sep 17 00:00:00 2001 From: Duco van Amstel Date: Mon, 27 May 2019 17:38:31 +0100 Subject: Linter fixes --- matterclient/channels.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/matterclient/channels.go b/matterclient/channels.go index c09a170f..ae1bf384 100644 --- a/matterclient/channels.go +++ b/matterclient/channels.go @@ -167,25 +167,25 @@ func (m *MMClient) JoinChannel(channelId string) error { //nolint:golint return nil } -func (m *MMClient) UpdateChannelsTeam(teamId string) error { - mmchannels, resp := m.Client.GetChannelsForTeamForUser(teamId, m.User.Id, "") +func (m *MMClient) UpdateChannelsTeam(teamID string) error { + mmchannels, resp := m.Client.GetChannelsForTeamForUser(teamID, m.User.Id, "") if resp.Error != nil { return errors.New(resp.Error.DetailedError) } for idx, t := range m.OtherTeams { - if t.Id == teamId { + if t.Id == teamID { m.Lock() m.OtherTeams[idx].Channels = mmchannels m.Unlock() } } - mmchannels, resp = m.Client.GetPublicChannelsForTeam(teamId, 0, 5000, "") + mmchannels, resp = m.Client.GetPublicChannelsForTeam(teamID, 0, 5000, "") if resp.Error != nil { return errors.New(resp.Error.DetailedError) } for idx, t := range m.OtherTeams { - if t.Id == teamId { + if t.Id == teamID { m.Lock() m.OtherTeams[idx].MoreChannels = mmchannels m.Unlock() @@ -195,9 +195,13 @@ func (m *MMClient) UpdateChannelsTeam(teamId string) error { } func (m *MMClient) UpdateChannels() error { - m.UpdateChannelsTeam(m.Team.Id) + if err := m.UpdateChannelsTeam(m.Team.Id); err != nil { + return err + } for _, t := range m.OtherTeams { - m.UpdateChannelsTeam(t.Id) + if err := m.UpdateChannelsTeam(t.Id); err != nil { + return err + } } return nil } -- cgit v1.2.3