package
Version:
v0.0.0-...-bcfc501
Opens a new window with list of versions in this module.
Published: Mar 24, 2025
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package slices provides slice-related utilities.
func Filter[T any, P ~func(T) bool](x []T, pred P) []T
Filter returns a copy of x with any elements for which pred returns true.
HasPrefix evaluates if x contains prefix as its first len(prefix) elements.
Iter returns an [iter.Seq[V]] that ranges over s.
Iter2 returns an [iter.Seq[int, V]] that ranges over s.
func Transform[From any, To any, P ~func(From) To](x []From, mapper P) []To
Transform returns a copy of x with all elements' values passed through the
given mapping function.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.