collections

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 0 Imported by: 1

Documentation

Overview

Package collection provides some useful functions for working with data structures that contain multiple elements.

Many languages have their own collection library:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter[V any](items []V, predicate func(it V) bool) []V

Filter iterates over items, returning an array of all items predicate returns truthy for.

func Map

func Map[T, R any](items []T, transform func(it T) R) []R

Map returns a slice containing the results of applying the given transform function to each item in the original slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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