Repository navigation
Collection v4 is the supported Go 1.27-native release of collection, rebuilt around a slice-backed API.
Highlights
Slice[T]is a named slice, solen, indexing, slicing,range, standard-library helpers, and iterator adapters work directly.- Generic methods keep type-changing transformations fluent.
- Pure operations have consistent ownership semantics.
TransformandRetainprovide explicit, zero-allocation mutation for hot paths.- Every exported function and method has an executable example.
- The benchmark suite includes direct lo comparisons and permanent v2/v4 regression coverage.
Upgrade
v4 requires Go 1.27 and uses the major-version module path:
import "github.com/goforj/collection/v4"Existing v2 consumers can upgrade when ready; v2 remains available.
See the v4 migration guide for method-by-method before-and-after examples, removed APIs, and ownership changes.