sliceutil

package
v0.0.0-...-df362b2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 0 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendUnique

func AppendUnique[T comparable](slice []T, elems ...T) []T

AppendUnique appends unique elements from elems to slice, avoiding duplicates.

func Contains

func Contains[T comparable](slice []T, item T) bool

Contains checks if a slice contains a specified element.

func DeleteEmpty

func DeleteEmpty[T comparable](list []T) []T

DeleteEmpty removes zero-value elements from a slice.

func Remove

func Remove[T comparable](slice []T, item T) []T

Remove deletes an item from a slice of elements.

func Unique

func Unique[T comparable](items []T) []T

Unique returns a slice with only unique elements, preserving the order of the first occurrence.

Types

This section is empty.

Jump to

Keyboard shortcuts

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