slices

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy[T any](input []T) (out []T)

Copy copies a slice

func ForEach added in v0.0.2

func ForEach[T any](input []T, fn func(index int, elem T))

func Map

func Map[I, O any](input []I, fn func(index int, elem I) O) (out []O)

Map maps a slice to another type. out will be a new slice. If fn == nil, nil is returned, otherwise len(out) == len(a).

func Reverse

func Reverse[T any](input []T) []T

Reverse reverses input in place, returning input.

Types

This section is empty.

Jump to

Keyboard shortcuts

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