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

Method TeamsToIDs

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

Source from the content-addressed store, hash-verified

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

Callers 2

AddMetadataToIssueParamsFunction · 0.80
Test_RepoMetadataFunction · 0.80

Calls 1

ErrorfMethod · 0.65

Tested by 1

Test_RepoMetadataFunction · 0.64