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

Function actorsToSearchResult

pkg/cmd/pr/shared/editable.go:685–705  ·  view source on GitHub ↗
(actors []api.AssignableActor, totalCount int)

Source from the content-addressed store, hash-verified

683}
684
685func actorsToSearchResult(actors []api.AssignableActor, totalCount int) prompter.MultiSelectSearchResult {
686 logins := make([]string, 0, len(actors))
687 displayNames := make([]string, 0, len(actors))
688
689 for _, a := range actors {
690 if a.Login() == "" {
691 continue
692 }
693 logins = append(logins, a.Login())
694 if a.DisplayName() != "" {
695 displayNames = append(displayNames, a.DisplayName())
696 } else {
697 displayNames = append(displayNames, a.Login())
698 }
699 }
700 return prompter.MultiSelectSearchResult{
701 Keys: logins,
702 Labels: displayNames,
703 MoreResults: totalCount,
704 }
705}

Callers 2

AssigneeSearchFuncFunction · 0.85
RepoAssigneeSearchFuncFunction · 0.85

Calls 2

LoginMethod · 0.65
DisplayNameMethod · 0.65

Tested by

no test coverage detected