slices

package
v2.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyMatches

func AnyMatches[T comparable, S ~[]T](s S, filter func(v T) bool) bool

AnyMatches checks if any value in the slice matches the filter. If so, true is returned, otherwise false.

func Contains

func Contains[T comparable, S ~[]T](slice S, value T) bool

Contains checks if a value is present in

func Difference

func Difference[T comparable, S ~[]T](a S, b S) S

Difference is removing all elements from a which are present in b. It is the mathematical set-operation equivalent as (A - B)

func Reverse added in v2.8.1

func Reverse[T any](s []T) []T

Reverse returns a new slice that is in reverse order of the given slice s. It does not modify the order of the given slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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