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