| 788 | } |
| 789 | |
| 790 | func (m *RepoMetadataResult) TeamsToIDs(names []string) ([]string, error) { |
| 791 | var ids []string |
| 792 | for _, teamSlug := range names { |
| 793 | found := false |
| 794 | slug := teamSlug[strings.IndexRune(teamSlug, '/')+1:] |
| 795 | for _, t := range m.Teams { |
| 796 | if strings.EqualFold(slug, t.Slug) { |
| 797 | ids = append(ids, t.ID) |
| 798 | found = true |
| 799 | break |
| 800 | } |
| 801 | } |
| 802 | if !found { |
| 803 | return nil, fmt.Errorf("'%s' not found", teamSlug) |
| 804 | } |
| 805 | } |
| 806 | return ids, nil |
| 807 | } |
| 808 | |
| 809 | func (m *RepoMetadataResult) LabelsToIDs(names []string) ([]string, error) { |
| 810 | var ids []string |