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