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

Function partitionReviewersByType

pkg/cmd/pr/edit/edit.go:628–643  ·  view source on GitHub ↗

partitionReviewersByType splits reviewer identifiers into users, bots, and teams. Team identifiers are in the form "org/slug" and are returned as-is. Bot logins (currently only Copilot) are identified and returned separately.

(values []string)

Source from the content-addressed store, hash-verified

626// Team identifiers are in the form "org/slug" and are returned as-is.
627// Bot logins (currently only Copilot) are identified and returned separately.
628func partitionReviewersByType(values []string) (users []string, bots []string, teams []string) {
629 for _, v := range values {
630 if v == "" {
631 continue
632 }
633 if strings.ContainsRune(v, '/') {
634 // Team: org/slug format, pass as-is
635 teams = append(teams, v)
636 } else if v == api.CopilotReviewerLogin {
637 bots = append(bots, v)
638 } else {
639 users = append(users, v)
640 }
641 }
642 return
643}

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected