last

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package last provides helpers for retrieving a last element of a slice that satisfies a condition

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByPredicate

type ByPredicate[T any] struct {
	// contains filtered or unexported fields
}

ByPredicate tail of the By method

func By

func By[T any](by func(T) bool) ByPredicate[T]

By an alias of the slice.Last

func (ByPredicate[T]) Of

func (l ByPredicate[T]) Of(elements ...T) (T, bool)

Of the predicate apply method

type OfElements

type OfElements[T any] struct {
	// contains filtered or unexported fields
}

OfElements tail of the Of method

func Of

func Of[T any](elements ...T) OfElements[T]

Of an alias of the slice.Last

func (OfElements[T]) By

func (l OfElements[T]) By(predicate func(T) bool) (T, bool)

By the predicate apply method

Jump to

Keyboard shortcuts

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