collections

package
v6.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package collections contains useful functions for working with collections

Index

Constants

This section is empty.

Variables

View Source
var ErrDuplicateKey = errors.New("duplicate key")

ErrDuplicateKey is returned when the key already exists in the map

Functions

func AddMap

func AddMap[K comparable, V any](to, from map[K]V) error

AddMap populates 'to' with elements found in 'from'

func ForEachInSlice

func ForEachInSlice[S ~[]E, E any](s S, fn func(a E) E)

ForEachInSlice applies the provided function for each element of the slice.

func StringInSlice

func StringInSlice(s []string, searchTerm string) bool

StringInSlice determines if the searched string appears in the array.

Types

This section is empty.

Jump to

Keyboard shortcuts

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