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