MCPcopy Create free account
hub / github.com/cli/cli / LabelsToIDs

Method LabelsToIDs

api/queries_repo.go:806–822  ·  view source on GitHub ↗
(names []string)

Source from the content-addressed store, hash-verified

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

Callers 3

AddMetadataToIssueParamsFunction · 0.80
UpdateIssueFunction · 0.80
Test_RepoMetadataFunction · 0.80

Calls 1

ErrorfMethod · 0.65

Tested by 1

Test_RepoMetadataFunction · 0.64