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

Method TeamsToIDs

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

Source from the content-addressed store, hash-verified

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

Callers 2

AddMetadataToIssueParamsFunction · 0.80
Test_RepoMetadataFunction · 0.80

Calls 1

ErrorfMethod · 0.65

Tested by 1

Test_RepoMetadataFunction · 0.64