MCPcopy
hub / github.com/cli/cli / initialize

Function initialize

pkg/search/searcher_test.go:1272–1278  ·  view source on GitHub ↗

initialize generate slices over a range for test scenarios using the provided initializer.

(start int, stop int, initializer func(i int) T)

Source from the content-addressed store, hash-verified

1270
1271// initialize generate slices over a range for test scenarios using the provided initializer.
1272func initialize[T any](start int, stop int, initializer func(i int) T) []T {
1273 results := make([]T, 0, (stop - start))
1274 for i := start; i < stop; i++ {
1275 results = append(results, initializer(i))
1276 }
1277 return results
1278}

Callers 4

TestSearcherCodeFunction · 0.85
TestSearcherCommitsFunction · 0.85
TestSearcherRepositoriesFunction · 0.85
TestSearcherIssuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected