xslices

package
v1.14.5 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reverse

func Reverse[T any, S ~[]T](s S) S

Reverse reverses the order of elements in a slice. It creates a new slice and returns it, leaving the original slice unchanged.

func Search[T any, S ~[]T](s S, f func(T) bool) (int, bool)

Search returns the index of the first element in s that satisfies f, or -1 if no such element exists. It returns a boolean indicating whether the element was found.

func Shuffle added in v1.6.1

func Shuffle[T any, S ~[]T](s S)

Shuffle randomly shuffles the elements of a slice in place. It uses the rand.Shuffle function from the math/rand/v2 package.

Types

This section is empty.

Jump to

Keyboard shortcuts

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