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

Method TeamsToIDs

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

Source from the content-addressed store, hash-verified

788}
789
790func (m *RepoMetadataResult) TeamsToIDs(names []string) ([]string, error) {
791 var ids []string
792 for _, teamSlug := range names {
793 found := false
794 slug := teamSlug[strings.IndexRune(teamSlug, '/')+1:]
795 for _, t := range m.Teams {
796 if strings.EqualFold(slug, t.Slug) {
797 ids = append(ids, t.ID)
798 found = true
799 break
800 }
801 }
802 if !found {
803 return nil, fmt.Errorf("'%s' not found", teamSlug)
804 }
805 }
806 return ids, nil
807}
808
809func (m *RepoMetadataResult) LabelsToIDs(names []string) ([]string, error) {
810 var ids []string

Callers 2

AddMetadataToIssueParamsFunction · 0.80
Test_RepoMetadataFunction · 0.80

Calls 1

ErrorfMethod · 0.65

Tested by 1

Test_RepoMetadataFunction · 0.64