MCPcopy Index your code
hub / github.com/cli/cli / LabelsToIDs

Method LabelsToIDs

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

Source from the content-addressed store, hash-verified

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