sliceutils

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: GPL-3.0, LGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package sliceutils provides utility functions for slices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Difference

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

Difference returns a slice with the elements that are in a but not in b.

func DifferenceFunc

func DifferenceFunc[S ~[]E, E any](a, b S, f func(E, E) bool) S

DifferenceFunc returns a slice with the elements that are in a but not in b, supporting a function to compare the items.

func EqualContent

func EqualContent[S ~[]E, E comparable](a S, b S) bool

EqualContent compares two slices, ensuring that their content is equal.

func EqualContentFunc

func EqualContentFunc[S ~[]E, E any](a S, b S, f func(E, E) bool) bool

EqualContentFunc compares two slices, ensuring that their content is equal using the provided function to compare.

func Intersection

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

Intersection returns a slice with the elements that are in both a and b.

func Map

func Map[T any, S ~[]E, E any](a S, f func(E) T) []T

Map maps the slice to another slice of the same size, using the provided function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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