first

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: 1

Documentation

Overview

Package first provides short aliases for slice functions for retrieving a first element

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Converted added in v0.0.8

func Converted[FS ~[]From, From, To any](elements FS, filter func(From) bool, converter func(From) To) (out To, ok bool)

Converted converts the first element that satisfies the condition of the 'filter' function by the converter and returns it

func Of

func Of[TS ~[]T, T any](elements TS, filter func(T) bool) (T, bool)

Of returns the first element that satisfies requirements of the specified filter

Types

This section is empty.

Jump to

Keyboard shortcuts

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