(dbx teamClient, arg *team.GroupsListArg)
| 41 | } |
| 42 | |
| 43 | func listTeamGroups(dbx teamClient, arg *team.GroupsListArg) ([]*team_common.GroupSummary, error) { |
| 44 | var groups []*team_common.GroupSummary |
| 45 | res, err := dbx.GroupsListContext(currentContext(), arg) |
| 46 | if err != nil { |
| 47 | return nil, err |
| 48 | } |
| 49 | groups = append(groups, res.Groups...) |
| 50 | |
| 51 | for res.HasMore { |
| 52 | if res.Cursor == "" { |
| 53 | return nil, errors.New("team group list has more results but no cursor") |
| 54 | } |
| 55 | res, err = dbx.GroupsListContinueContext(currentContext(), team.NewGroupsListContinueArg(res.Cursor)) |
| 56 | if err != nil { |
| 57 | return nil, err |
| 58 | } |
| 59 | groups = append(groups, res.Groups...) |
| 60 | } |
| 61 | return groups, nil |
| 62 | } |
| 63 | |
| 64 | func renderTeamGroups(out io.Writer, groups []*team_common.GroupSummary) error { |
| 65 | if len(groups) == 0 { |
no test coverage detected