collections

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.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 collections provides generic collection utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Keys

func Keys[K comparable, V any](m map[K]V) []K

Keys returns the keys of a map.

func ListContainsElement

func ListContainsElement[T comparable](list []T, element T) bool

ListContainsElement returns true if the list contains the given element.

func ListIntersection

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

ListIntersection returns elements that are in both lists.

func MapJoin

func MapJoin[K comparable, V any](m map[K]V, argSep string, valSep string) string

MapJoin joins a map into a string with the given argument and value separators. Example: MapJoin({"a": "1", "b": "2"}, ",", "=") → "a=1,b=2"

func MergeMaps

func MergeMaps[K comparable, V any](maps ...map[K]V) map[K]V

MergeMaps merges multiple maps into one. Later maps override earlier ones.

Types

This section is empty.

Jump to

Keyboard shortcuts

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