collections

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Intersection

func Intersection[T comparable](a, b []T) []T

Intersection returns a new slice with the common elements between a and b.

func RandomElement

func RandomElement[T any](slice []T) (T, bool)

RandomElement returns a random element from the slice, and a boolean indicating whether the slice was empty.

func Subtract

func Subtract[T comparable](a, b []T) []T

Subtract removes all the items in b from a.

Types

This section is empty.

Jump to

Keyboard shortcuts

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