Skip to content

Instantly share code, notes, and snippets.

@prateeksriv
Created November 3, 2016 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prateeksriv/65093eb187edf56bfacebabbf32abfea to your computer and use it in GitHub Desktop.
Save prateeksriv/65093eb187edf56bfacebabbf32abfea to your computer and use it in GitHub Desktop.
func mattermostPrintChannels(client *mattermost.Client) {
channelsResult, err := client.GetChannels("")
if err != nil {
fmt.Print("Couldn't get channels: ", err)
return
}
channelList := channelsResult.Data.(*mattermost.ChannelList)
fmt.Print("Channels:")
for _, channel := range channelList.Channels {
fmt.Printf("%s -> %s", channel.Id, channel.DisplayName)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment