import ( "github.com/mattermost/platform/model" ) func main() { team := &model.Team{ Name: "myteam", DisplayName: "My Team", Description: "This is my team", Type: "O", } createdTeam, err := client.CreateTeam(team) if err != nil { panic(err) } fmt.Println(createdTeam.ID) }
import ( "github.com/mattermost/platform/model" ) func main() { team, err := client.GetTeamByName("myteam") if err != nil { panic(err) } fmt.Println(team.DisplayName) }This example calls the GetTeamByName method on a Mattermost API client to retrieve a team by its name. If successful, the display name of the team is printed to the console. In both examples, we can see that we are using the github.com.mattermost.platform.model package to work with Mattermost Teams.