MCPcopy Index your code
hub / github.com/cli/cli / partitionReviewersByType

Function partitionReviewersByType

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

542// Team identifiers are in the form "org/slug" and are returned as-is.
543// Bot logins (currently only Copilot) are identified and returned separately.
544func partitionReviewersByType(values []string) (users []string, bots []string, teams []string) {
545 for _, v := range values {
546 if v == "" {
547 continue
548 }
549 if strings.ContainsRune(v, '/') {
550 // Team: org/slug format, pass as-is
551 teams = append(teams, v)
552 } else if v == api.CopilotReviewerLogin {
553 bots = append(bots, v)
554 } else {
555 users = append(users, v)
556 }
557 }
558 return
559}

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected