ProjectsTitlesToIDs returns two arrays: - the first contains IDs of projects V1 - the second contains IDs of projects V2 - if neither project V1 or project V2 can be found with a given name, then an error is returned
(titles []string)
| 829 | // - the second contains IDs of projects V2 |
| 830 | // - if neither project V1 or project V2 can be found with a given name, then an error is returned |
| 831 | func (m *RepoMetadataResult) ProjectsTitlesToIDs(titles []string) ([]string, []string, error) { |
| 832 | var ids []string |
| 833 | var idsV2 []string |
| 834 | for _, title := range titles { |
| 835 | id, found := m.v1ProjectNameToID(title) |
| 836 | if found { |
| 837 | ids = append(ids, id) |
| 838 | continue |
| 839 | } |
| 840 | |
| 841 | idV2, found := m.v2ProjectTitleToID(title) |
| 842 | if found { |
| 843 | idsV2 = append(idsV2, idV2) |
| 844 | continue |
| 845 | } |
| 846 | |
| 847 | return nil, nil, fmt.Errorf("'%s' not found", title) |
| 848 | } |
| 849 | return ids, idsV2, nil |
| 850 | } |
| 851 | |
| 852 | // We use the word "titles" when referring to v1 and v2 projects. |
| 853 | // In reality, v1 projects really have "names", so there is a bit of a |