(names []string)
| 808 | } |
| 809 | |
| 810 | func (m *RepoMetadataResult) LabelsToIDs(names []string) ([]string, error) { |
| 811 | var ids []string |
| 812 | for _, labelName := range names { |
| 813 | found := false |
| 814 | for _, l := range m.Labels { |
| 815 | if strings.EqualFold(labelName, l.Name) { |
| 816 | ids = append(ids, l.ID) |
| 817 | found = true |
| 818 | break |
| 819 | } |
| 820 | } |
| 821 | if !found { |
| 822 | return nil, fmt.Errorf("'%s' not found", labelName) |
| 823 | } |
| 824 | } |
| 825 | return ids, nil |
| 826 | } |
| 827 | |
| 828 | // ProjectsTitlesToIDs returns two arrays: |
| 829 | // - the first contains IDs of projects V1 |