util

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Map

func Map[A any, B any](coll []A, mapper func(i A, index uint64) B) []B

Map applies a transformation function to each element of a slice and returns a new slice with the transformed values. This is a generic implementation of the map higher-order function.

Type Parameters:

  • A: The type of elements in the input slice
  • B: The type of elements in the output slice

Parameters:

  • coll: The input slice to transform
  • mapper: Function that transforms each element and receives the element's index

Returns:

  • []B: A new slice containing the transformed elements

Types

This section is empty.

Jump to

Keyboard shortcuts

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