slices

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Overview

Package slices provides complementary functions to slices package from standard library.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapFunc

func MapFunc[E1, E2 any](s []E1, f func(E1) E2) []E2

MapFunc transforms every item in the sequence to a new sequence of items generated by function f.

Example
package main

import (
	"fmt"

	"github.com/skhal/lab/go/slices"
)

func main() {
	nn := slices.MapFunc([]int{1, 2, 3}, func(n int) int { return n * 2 })
	fmt.Println(nn)
}
Output:
[2 4 6]

Types

This section is empty.

Jump to

Keyboard shortcuts

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