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

Method LabelsToIDs

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

Source from the content-addressed store, hash-verified

807}
808
809func (m *RepoMetadataResult) LabelsToIDs(names []string) ([]string, error) {
810 var ids []string
811 for _, labelName := range names {
812 found := false
813 for _, l := range m.Labels {
814 if strings.EqualFold(labelName, l.Name) {
815 ids = append(ids, l.ID)
816 found = true
817 break
818 }
819 }
820 if !found {
821 return nil, fmt.Errorf("'%s' not found", labelName)
822 }
823 }
824 return ids, nil
825}
826
827// ProjectsTitlesToIDs returns two arrays:
828// - 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