filter

package
v2.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterSlice

func FilterSlice[T any](sl []T, filter func(T) bool) []T

FilterSlice filters elements in a slice based on a provided filter function. It iterates over each element in the input slice 'sl' and applies the 'filter' function to each element. If the 'filter' function returns true for an element, that element is included in the resulting slice. If the 'filter' function is nil, the original slice 'sl' is returned as is. The function returns a new slice containing the filtered elements.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL