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

Function searchResults

pkg/cmd/extension/command_test.go:1150–1194  ·  view source on GitHub ↗
(numResults int)

Source from the content-addressed store, hash-verified

1148}
1149
1150func searchResults(numResults int) any {
1151 result := map[string]any{
1152 "incomplete_results": false,
1153 "total_count": 4,
1154 "items": []any{
1155 map[string]any{
1156 "name": "gh-screensaver",
1157 "full_name": "vilmibm/gh-screensaver",
1158 "description": "terminal animations",
1159 "owner": map[string]any{
1160 "login": "vilmibm",
1161 },
1162 },
1163 map[string]any{
1164 "name": "gh-cool",
1165 "full_name": "cli/gh-cool",
1166 "description": "it's just cool ok",
1167 "owner": map[string]any{
1168 "login": "cli",
1169 },
1170 },
1171 map[string]any{
1172 "name": "gh-triage",
1173 "full_name": "samcoe/gh-triage",
1174 "description": "helps with triage",
1175 "owner": map[string]any{
1176 "login": "samcoe",
1177 },
1178 },
1179 map[string]any{
1180 "name": "gh-gei",
1181 "full_name": "github/gh-gei",
1182 "description": "something something enterprise",
1183 "owner": map[string]any{
1184 "login": "github",
1185 },
1186 },
1187 },
1188 }
1189 if len(result["items"].([]any)) > numResults {
1190 fewerItems := result["items"].([]any)[0:numResults]
1191 result["items"] = fewerItems
1192 }
1193 return result
1194}

Callers 1

TestNewCmdExtensionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected