MCPcopy Index your code
hub / github.com/coder/coder / filterSlice

Function filterSlice

cli/help.go:264–272  ·  view source on GitHub ↗
(s []T, f func(T) bool)

Source from the content-addressed store, hash-verified

262}()
263
264func filterSlice[T any](s []T, f func(T) bool) []T {
265 var r []T
266 for _, v := range s {
267 if f(v) {
268 r = append(r, v)
269 }
270 }
271 return r
272}
273
274// newLineLimiter makes working with Go templates more bearable. Without this,
275// modifying the template is a slow toil of counting newlines and constantly

Callers 1

help.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected