slices

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Count

func Count[V any](slice []V, filter func(item V) bool) (x int)

func Each

func Each[V any](slice []V, fn func(item V) bool)

func Find

func Find[V any](slice []V, fn func(item V) bool) *V

func FindCopy

func FindCopy[V any](slice []V, fn func(item V) bool) (item V, found bool)

func FindIndex

func FindIndex[V any](slice []V, fn func(item V) bool) int

func Sum

func Sum[V constraints.Integer](slice []V) (x int)

func SumCustom

func SumCustom[V any](slice []V, fn func(item V) int) (x int)

Types

type List

type List[V any] []V

func (List[V]) Find

func (x List[V]) Find(fn func(item V) bool) (data V, ok bool)

Jump to

Keyboard shortcuts

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