MCPcopy
hub / github.com/cli/cli / extractTeamSlugs

Function extractTeamSlugs

api/queries_pr_review.go:680–690  ·  view source on GitHub ↗

extractTeamSlugs extracts just the slug portion from team identifiers. Team identifiers can be in "org/slug" format; this returns just the slug.

(teams []string)

Source from the content-addressed store, hash-verified

678// extractTeamSlugs extracts just the slug portion from team identifiers.
679// Team identifiers can be in "org/slug" format; this returns just the slug.
680func extractTeamSlugs(teams []string) []string {
681 slugs := make([]string, 0, len(teams))
682 for _, t := range teams {
683 if t == "" {
684 continue
685 }
686 s := strings.SplitN(t, "/", 2)
687 slugs = append(slugs, s[len(s)-1])
688 }
689 return slugs
690}
691
692// toGitHubV4Strings converts a string slice to a githubv4.String slice,
693// optionally appending a suffix to each element.

Callers 2

AddPullRequestReviewsFunction · 0.85
RemovePullRequestReviewsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected