slicex

package
v2.10.53 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 0 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fill added in v2.2.109

func Fill[T any](value T, number int) []T

Fill fills the slice with the given number of values

func Filter

func Filter[T any](values []T, predicate func(value T) bool) []T

Filter does what it says and creates a new list with all values which evaluate the predicate to true.

func MakeWithCapacity

func MakeWithCapacity[T any](cap int) []T

MakeWithCapacity exists to simply create a slice with the provided pre-allocated capacity. Why not just use `make([]T, cap)` you might ask? Well, cause that's broken again. You've missed the zero indicating a length of zero - again. Thanks go.

func Map

func Map[T any, R any](input []T, mapper func(T) R) []R

Map applies the mapper function to each item of the input slice and returns a new slice with the mapped values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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