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