filter

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Distinct added in v1.3.0

func Distinct[T comparable](slice []T) []T

Distinct returns a slice of distinct values from the input slice. Example: It returns [1 2 3] for input [1 1 1 2 2 3].

func Filter

func Filter[T any](slice []T, filter func(element T) bool) []T

Filter gets a slice and a function where you can define custom filter conditions to get a specific subset of the input slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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