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