sliceutils

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: GPL-3.0, LGPL-3.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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