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

Function filterCodespacesByRepoOwner

pkg/cmd/codespace/common.go:262–270  ·  view source on GitHub ↗

filterCodespacesByRepoOwner filters a list of codespaces by the owner of the repository.

(codespaces []*api.Codespace, repoOwner string)

Source from the content-addressed store, hash-verified

260
261// filterCodespacesByRepoOwner filters a list of codespaces by the owner of the repository.
262func filterCodespacesByRepoOwner(codespaces []*api.Codespace, repoOwner string) []*api.Codespace {
263 filtered := make([]*api.Codespace, 0, len(codespaces))
264 for _, c := range codespaces {
265 if strings.EqualFold(c.Repository.Owner.Login, repoOwner) {
266 filtered = append(filtered, c)
267 }
268 }
269 return filtered
270}

Callers 2

DeleteMethod · 0.85
fetchCodespacesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected