generic

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enumerable

type Enumerable[T any] []T

Enumerable contains methods for working with slices

func AsEnumerable

func AsEnumerable[T any](items []T) Enumerable[T]

AsEnumerable converts a slice to an Enumerable object

func (Enumerable[T]) Distinct

func (src Enumerable[T]) Distinct(keySelector func(item T) any) Enumerable[T]

Distinct returns a distinct list of objects based the value returned by keySelector

func (Enumerable[T]) Last

func (src Enumerable[T]) Last() (T, bool)

Last returns the last item in the list

func (Enumerable[T]) OrderBy

func (src Enumerable[T]) OrderBy(compare func(first, second T) bool) Enumerable[T]

OrderBy returns a sorted copy of the items

Jump to

Keyboard shortcuts

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