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

Function actorsToSearchResult

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

Source from the content-addressed store, hash-verified

698}
699
700func actorsToSearchResult(actors []api.AssignableActor, totalCount int) prompter.MultiSelectSearchResult {
701 logins := make([]string, 0, len(actors))
702 displayNames := make([]string, 0, len(actors))
703
704 for _, a := range actors {
705 if a.Login() == "" {
706 continue
707 }
708 logins = append(logins, a.Login())
709 if a.DisplayName() != "" {
710 displayNames = append(displayNames, a.DisplayName())
711 } else {
712 displayNames = append(displayNames, a.Login())
713 }
714 }
715 return prompter.MultiSelectSearchResult{
716 Keys: logins,
717 Labels: displayNames,
718 MoreResults: totalCount,
719 }
720}

Callers 2

AssigneeSearchFuncFunction · 0.85
RepoAssigneeSearchFuncFunction · 0.85

Calls 2

LoginMethod · 0.65
DisplayNameMethod · 0.65

Tested by

no test coverage detected