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

Function partitionReviewersByType

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

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

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected