MCPcopy
hub / github.com/cli/cli / TeamsToIDs

Method TeamsToIDs

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

Source from the content-addressed store, hash-verified

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

Callers 2

AddMetadataToIssueParamsFunction · 0.80
Test_RepoMetadataFunction · 0.80

Calls 1

ErrorfMethod · 0.65

Tested by 1

Test_RepoMetadataFunction · 0.64