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