package
Version:
v0.0.0-...-45b38f9
Opens a new window with list of versions in this module.
Published: Dec 24, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package slice implements helpers for slice operations
type Chain[T any] struct {
}
Chain is a series of slices of type T that have been "chained"
together, i.e. they can be iterated on as one slice
func NewChain[T any](slices ...[]T) Chain[T]
NewChain returns a new chain composed of the passed
in slices
Get returns a slice item at index `i`, where 0 <= `i` < c.Len()
func (c Chain[T]) Iterate(f func(i int, v *T))
Iterate iterates over the chained slices in order calling function `f` on each item
Len returns the sum of the lengths of the chained slices
Source Files
¶
Click to show internal directories.
Click to hide internal directories.