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

Function partitionReviewersByType

pkg/cmd/pr/edit/edit.go:627–642  ·  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

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

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected