Functional programming helpers for Golang using samber/lo — 500+ type-safe generic functions for slices, maps, channels, strings, math, tuples, and concurrency (Map, Filter, Reduce, GroupBy, Chunk, Flatten, Find, Uniq, etc.). Core immutable package (lo), concurrent variants (lo/parallel aka lop), in-place mutations (lo/mutable aka lom), lazy iterators (lo/it aka loi for Go 1.23+), and experimental SIMD (lo/exp/simd). Apply when using or adopting samber/lo, when the codebase imports github.com/sa
The golang-samber-lo skill provides guidance and best practices for using the samber/lo ecosystem in Go projects. It focuses on functional-style programming patterns for collections and data transformations, helping developers replace repetitive manual loops with expressive, type-safe generic helpers. The skill is designed for projects that already use or plan to adopt github.com/samber/lo, and it helps developers apply immutable transformations, collection utilities, and declarative processing patterns while remaining aligned with Go idioms. It addresses common gaps in the Go standard library by providing reusable utilities for mapping, filtering, grouping, chunking, flattening, reducing, and related operations.
The skill covers the core immutable lo package as well as specialized companion packages for concurrency, mutable operations, iterators, and experimental SIMD support. It highlights when to use standard immutable helpers versus when to adopt parallel execution with lop, in-place mutations with lom, or lazy iterators with loi. The library emphasizes compile-time type safety, zero external dependencies, composability, and predictable behavior. It also includes support for error-aware helper variants such as MapErr, FilterErr, and ReduceErr, which stop execution on the first encountered error. The skill additionally explains package compatibility requirements across different Go versions and provides guidance on performance trade-offs.
This skill is intended for Go engineers, backend developers, and AI coding agents working on data-heavy or transformation-oriented applications. It is especially useful in services that process slices, maps, channels, or structured datasets where readability and maintainability are priorities. Teams adopting modern generics-based Go patterns can use this skill to standardize functional utilities, reduce boilerplate, and improve code clarity while understanding the limitations of concurrency overhead, mutation side effects, and iterator complexity.
samber/lo provides functional-style helpers for slices, maps, strings, math, tuples, channels, and concurrency so developers can avoid repetitive manual for-loops and implement declarative collection transformations more efficiently.
The lo package is the default choice for most transformations because it is immutable and predictable. lop is intended for CPU-bound work on large datasets, lom is useful for allocation-sensitive hot paths where mutation is acceptable, and loi is designed for lazy iterator-based processing on large chained transformations.
The core lo, parallel, and mutable packages require Go 1.18 or newer. The iterator package loi requires Go 1.23+, while the experimental SIMD package requires Go 1.25+ and currently supports amd64 only.
No. The library is designed around Go generics and emphasizes type-safe operations without interface{} casts or reflection-based helpers.
Yes. Immutable helpers allocate new collections, parallel processing introduces goroutine overhead for smaller datasets, mutable operations can create side effects, and iterator-based processing adds complexity even though it may reduce memory usage.
Quick Setup:
.claude/skills/Repository
samber/cc-skills-golang