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