(s []T, f func(T) bool)
| 262 | }() |
| 263 | |
| 264 | func 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 |