collections

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDuplicates

func CheckDuplicates[T comparable](items []T) error

CheckDuplicates checks if a slice of ints or strings contains duplicates. It returns an error listing the duplicated values, or nil if all unique.

func Diff

func Diff[S ~[]E, E comparable](s1, s2 S) S

Diff finds the difference between two slices by returning elements from s1 that are not in s2.

func ListToMap

func ListToMap(slice []string) map[string]bool

ListToMap converts a slice of strings to a map of strings with boolean true values.

func MergeChannels

func MergeChannels[T any](channels []<-chan T) <-chan T

MergeChannels merges multiple channels into a single channel by sending values concurrently from each input channel to the output channel. The output channel is closed when all the input channels are closed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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